| 1 | # $Id: footer-misc.kmk 2726 2014-02-26 23:23:54Z bird $ | 
|---|
| 2 | ## @file | 
|---|
| 3 | # kBuild - Footer - Target lists - Pass 2 - Misc. | 
|---|
| 4 | # | 
|---|
| 5 |  | 
|---|
| 6 | # | 
|---|
| 7 | # Copyright (c) 2004-2014 knut st. osmundsen <bird-kBuild-spam-xiv@anduin.net> | 
|---|
| 8 | # | 
|---|
| 9 | # This file is part of kBuild. | 
|---|
| 10 | # | 
|---|
| 11 | # kBuild is free software; you can redistribute it and/or modify | 
|---|
| 12 | # it under the terms of the GNU General Public License as published by | 
|---|
| 13 | # the Free Software Foundation; either version source of the License, or | 
|---|
| 14 | # (at your option) any later version. | 
|---|
| 15 | # | 
|---|
| 16 | # kBuild is distributed in the hope that it will be useful, | 
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | # GNU General Public License for more details. | 
|---|
| 20 | # | 
|---|
| 21 | # You should have received a copy of the GNU General Public License | 
|---|
| 22 | # along with kBuild; if not, write to the Free Software | 
|---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
|---|
| 24 | # | 
|---|
| 25 | # | 
|---|
| 26 | # As a special exception you are granted permission to include this file, via | 
|---|
| 27 | # the kmk include directive, as you wish without this in itself causing the | 
|---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license. | 
|---|
| 29 | # This exception does not however invalidate any other reasons why the makefile, | 
|---|
| 30 | # program, whatever should not be covered the GPL. | 
|---|
| 31 | # | 
|---|
| 32 | # | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | # | 
|---|
| 36 | # OTHERS | 
|---|
| 37 | # | 
|---|
| 38 | _OTHERS = $(OTHERS) $(OTHERS.$(KBUILD_TARGET)) $(OTHERS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) | 
|---|
| 39 |  | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 | # | 
|---|
| 43 | # TESTING | 
|---|
| 44 | # | 
|---|
| 45 | _TESTING += $(TESTING) \ | 
|---|
| 46 | $(TESTING.$(KBUILD_TARGET)) \ | 
|---|
| 47 | $(TESTING.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \ | 
|---|
| 48 | $(TESTING.$(KBUILD_TARGET_ARCH)) \ | 
|---|
| 49 | $(TESTING.$(KBUILD_TARGET_CPU)) | 
|---|
| 50 |  | 
|---|
| 51 |  | 
|---|
| 52 | # | 
|---|
| 53 | # PACKING | 
|---|
| 54 | # | 
|---|
| 55 | _PACKING += $(PACKING) \ | 
|---|
| 56 | $(PACKING.$(KBUILD_TARGET)) \ | 
|---|
| 57 | $(PACKING.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \ | 
|---|
| 58 | $(PACKING.$(KBUILD_TARGET_ARCH)) \ | 
|---|
| 59 | $(PACKING.$(KBUILD_TARGET_CPU)) | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 | # | 
|---|
| 63 | # DOCS | 
|---|
| 64 | # | 
|---|
| 65 |  | 
|---|
| 66 |  | 
|---|
| 67 | # | 
|---|
| 68 | # DIRECTORIES | 
|---|
| 69 | # | 
|---|
| 70 | _DIR_ALL := $(sort \ | 
|---|
| 71 | $(addsuffix /,$(patsubst %/,%,$(_DIRS) )) \ | 
|---|
| 72 | $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS_FILES) $(_DEBUG_INSTALL_FILES) $(_STAGE_FILES) $(_DEBUG_STAGE_FILES) ) \ | 
|---|
| 73 | $(foreach path, $(KBUILD_INST_PATHS), $(PATH_INS)/$(INST_$(path)) $(PATH_STAGE)/$(STAGE_$(path)) ) \ | 
|---|
| 74 | $(dir $(patsubst %/,%, $(_INSTALLS_DIRS) $(_STAGE_DIRS) $(_DEBUG_INSTALL_DIRS) $(_DEBUG_STAGE_DIRS)) ) \ | 
|---|
| 75 | ) | 
|---|
| 76 | $(foreach directory, \ | 
|---|
| 77 | $(_INSTALLS_DIRS) \ | 
|---|
| 78 | $(_STAGE_DIRS) \ | 
|---|
| 79 | $(_DEBUG_INSTALL_DIRS) \ | 
|---|
| 80 | $(_DEBUG_STAGE_DIRS) \ | 
|---|
| 81 | , $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL))) ) | 
|---|
| 82 |  | 
|---|
| 83 |  | 
|---|
| 84 | define def_mkdir_rule | 
|---|
| 85 | $(directory): | 
|---|
| 86 | %$$(call MSG_MKDIR,$$@) | 
|---|
| 87 | $$(QUIET)$$(MKDIR) -p -- $$@ | 
|---|
| 88 | endef | 
|---|
| 89 |  | 
|---|
| 90 | $(foreach directory,$(_DIR_ALL),$(eval $(def_mkdir_rule))) | 
|---|
| 91 |  | 
|---|
| 92 | ifdef KBUILD_PROFILE_SELF | 
|---|
| 93 | $(evalcall def_profile_self, done directories) | 
|---|
| 94 | endif | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 | # | 
|---|
| 98 | # NOTHING | 
|---|
| 99 | # | 
|---|
| 100 | do-nothing: | 
|---|
| 101 | %$(call MSG_NOTHING) | 
|---|
| 102 | ifdef KBUILD_PROFILE_SELF | 
|---|
| 103 | @$(ECHO) 'prof: $(call _KBUILD_FMT_ELAPSED_EX, $(nanots ), $(_KBUILD_TS_HEADER_START)) - $(call _KBUILD_FMT_ELAPSED_EX, $(nanots ), $(_KBUILD_TS_PREV)) - executing $@' | 
|---|
| 104 | ifeq ($(KBUILD_PROFILE_SELF),2) | 
|---|
| 105 | @$(ECHO) 'stat: $(make-stats )' | 
|---|
| 106 | endif | 
|---|
| 107 | endif | 
|---|
| 108 |  | 
|---|
| 109 |  | 
|---|
| 110 | # | 
|---|
| 111 | # CLEAN UP | 
|---|
| 112 | # | 
|---|
| 113 | do-clean: | 
|---|
| 114 | %$(call MSG_CLEAN) | 
|---|
| 115 | $(QUIET)$(RM) -f -- \ | 
|---|
| 116 | $(_OUT_FILES) \ | 
|---|
| 117 | $(_OBJS) \ | 
|---|
| 118 | $(_DEPFILES) \ | 
|---|
| 119 | $(_DEPFILES_INCLUDED) \ | 
|---|
| 120 | $(_CLEAN_FILES) \ | 
|---|
| 121 | $(OTHER_CLEAN) \ | 
|---|
| 122 | $(_STAGE_FILES) | 
|---|
| 123 | $(QUIET)$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist -- \ | 
|---|
| 124 | $(rsort $(dir   $(_OUT_FILES) \ | 
|---|
| 125 | $(_OBJS) \ | 
|---|
| 126 | $(_DEPFILES) \ | 
|---|
| 127 | $(_DEPFILES_INCLUDED) \ | 
|---|
| 128 | $(_CLEAN_FILES) \ | 
|---|
| 129 | $(OTHER_CLEAN))\ | 
|---|
| 130 | $(_STAGE_DIRS) ) | 
|---|
| 131 |  | 
|---|