Changeset 588 for CMT/HEAD/src/Makefile.header
- Timestamp:
- Nov 27, 2011, 4:36:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/src/Makefile.header
r547 r588 19 19 20 20 cmt_local_tagfile = $(bin)$(tag).make 21 cmt_broadcast_tagfile = $(bin)$(tag)_broadcast.make 21 22 22 23 cmt_constituents_makefile = $(bin)constituents.make 23 24 cmt_local_setup = $(bin)setup$$$$.make 25 #cmt_local_setup = $(bin)$(package)setup$$$$.make 26 #cmt_final_setup = $(bin)${PACKAGE}setup.make 24 cmt_broadcast_makefile = $(bin)broadcast.make 25 27 26 cmt_final_setup = $(bin)setup.make 28 #cmt_final_setup = $(bin)$(package)setup.make 29 30 # 31 # Generic entry points for all targets 32 # 33 #ifndef QUICK 34 #all :: check_config ; 35 #else 36 #all :: no_check_config ; 37 #endif 38 #all :: $(cmt_constituents_makefile) 39 # @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@ 40 default :: all ; 27 28 cmt_check_configurationstamp = $(bin)cmt_check_configuration.stamp 29 30 ifdef CMTBCAST 31 QUICK = 1 32 endif 33 34 ifdef QUICK 35 ifndef CMTBCAST 36 37 ifneq ($(MAKECMDGOALS),binclean) 38 ifneq ($(MAKECMDGOALS),help) 39 cmt_included = 1 40 -include $(cmt_local_tagfile) 41 endif 42 endif 43 44 else 45 46 ifneq ($(MAKECMDGOALS),help) 47 cmt_included = 1 48 -include $(cmt_broadcast_tagfile) 49 endif 50 51 endif 52 endif 53 54 all :: 55 ifndef CMTBCAST 56 ifndef cmt_included 57 @$(MAKE) $(cmt_constituents_makefile) 58 endif 59 $(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@ 60 else 61 ifndef cmt_included 62 @$(MAKE) $(cmt_broadcast_makefile) 63 endif 64 @$(MAKE) --no-print-directory -f $(cmt_broadcast_makefile) CMTBCAST= $@ 65 endif 66 67 .DEFAULT : 68 ifndef CMTBCAST 69 ifndef cmt_included 70 @$(MAKE) $(cmt_constituents_makefile) 71 endif 72 @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@ 73 else 74 ifndef cmt_included 75 @$(MAKE) $(cmt_broadcast_makefile) 76 endif 77 @$(MAKE) --no-print-directory -f $(cmt_broadcast_makefile) CMTBCAST= $@ 78 endif 41 79 42 80 check_config :: 43 @$(cmtexe) check configuration; retval=$$?; \ 44 if test $${retval} -ne 0; then \ 45 test -z "$(cmtmsg)" || \ 46 echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \ 47 fi; exit $${retval} 48 49 # @$(cmtexe) check configuration; retval=$$?; \ 50 # if test $${retval} = 0; then \ 51 # $(MAKE) --no-print-directory target="all" common_target; \ 52 # else \ 53 # test -z "$(cmtmsg)" || \ 54 # echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \ 55 # fi 56 57 #no_check_config :: 58 # @$(MAKE) --no-print-directory target="all" common_target 59 60 binclean :: 61 if test ! "$(bin)" = "./"; then \ 62 if test -d $(bin) ; then \ 63 test -z "$(cmtmsg)" || \ 64 echo "$(CMTMSGPREFIX)" "(Makefile.header) Removing binary directory $(bin)"; \ 65 \rm -rf $(bin) ; \ 66 fi ; \ 67 fi 68 69 #clean uninstall :: check_config 70 # @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@ 71 # @$(cmtexe) check configuration 72 # @$(MAKE) --no-print-directory target="$@" common_target 73 74 .DEFAULT :: 75 @$(MAKE) $(cmt_constituents_makefile) 76 @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@ 77 78 # @$(cmtexe) check configuration 79 # @$(MAKE) --no-print-directory target="$@" common_target 80 # @$(MAKE) --no-print-directory target="config $@" common_target 81 82 # 83 # Capture all possible targets 84 # 85 #common_target : $(cmt_constituents_makefile) 86 # @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $(target) 87 88 #$(cmt_constituents_makefile) : $(cmt_local_tagfile) 81 +@$(cmtexe) check configuration; retval=$$?; \ 82 if test $${retval} -ne 0; then \ 83 test -z "$(cmtmsg)" || \ 84 echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \ 85 fi; exit $${retval} 86 87 $(cmt_check_configurationstamp) : $(use_requirements) 88 +@$(cmtexe) check configuration; retval=$$?; \ 89 if test $${retval} -ne 0; then \ 90 test -z "$(cmtmsg)" || \ 91 echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \ 92 fi; exit $${retval} 93 +$(silent) if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi && \touch $@ 94 # echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; exit 17 89 95 90 96 ifndef QUICK 91 $(cmt_constituents_makefile) : check_config 92 else 93 $(cmt_constituents_makefile) : 94 endif 95 $(echo) "(Makefile.header) Rebuilding $@"; \ 97 $(cmt_constituents_makefile) :: 98 #$(cmt_constituents_makefile) : check_config 99 else 100 $(cmt_local_tagfile) $(cmt_constituents_makefile) : $(use_requirements) 101 #$(cmt_local_tagfile) $(cmt_constituents_makefile) : $(cmt_check_configurationstamp) 102 endif 103 +$(echo) "(Makefile.header) Rebuilding $@"; \ 96 104 if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi; \ 97 $(cmtexe) -tag=$(tags) build constituents_config -out=$ @; \105 $(cmtexe) -tag=$(tags) build constituents_config -out=$(cmt_constituents_makefile); \ 98 106 retval=$$?; \ 99 107 if test $${retval} -ne 0; then \ … … 105 113 106 114 ifndef QUICK 107 $(cmt_ local_tagfile) ::108 else 109 $(cmt_local_tagfile) : 110 endif 111 $(echo) "(Makefile.header) Rebuilding $@"; \ 112 if test -f $@; then rm -f $@; fi; \ 113 if test ! -d $(@D); then $(mkdir) -p $(@D); fi; \114 $(cmtexe) -tag=$(tags) build tag_makefile >$@115 $(echo) "(Makefile.header) Rebuilding $(cmt_final_setup)"; \116 test ! -f $(cmt_local_setup) || \rm -f $(cmt_local_setup); \117 trap '\rm -f $(cmt_local_setup)' 0 1 2 15;\118 $(cmtexe) -tag=$(tags) show setup >$(cmt_local_setup) &&\119 if [ -f $(cmt_final_setup) ] &&\120 \ cmp -s $(cmt_final_setup) $(cmt_local_setup); then\121 \rm $(cmt_local_setup); else\122 \mv -f $(cmt_local_setup) $(cmt_final_setup); fi115 $(cmt_broadcast_makefile) :: 116 #$(cmt_broadcast_makefile) : check_config 117 else 118 $(cmt_broadcast_tagfile) $(cmt_broadcast_makefile) : $(use_requirements) 119 #$(cmt_broadcast_makefile) : $(cmt_check_configurationstamp) 120 endif 121 +$(echo) "(Makefile.header) Rebuilding $@"; \ 122 if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi; \ 123 $(cmtexe) -tag=$(tags) build broadcast_config -out=$(cmt_broadcast_makefile); \ 124 retval=$$?; \ 125 if test $${retval} -ne 0; then \ 126 test -z "$(cmtmsg)" || \ 127 echo "$(CMTMSGPREFIX)" "(Makefile.header) Cannot generate $@" >&2; \ 128 \rm -f $@; \ 129 fi; \ 130 exit $${retval} 123 131 124 132 # … … 134 142 everywhere :: $(everywhere) 135 143 144 ifndef CMTBCAST 145 binclean :: 146 if _bin=`cd $(bin) 2>/dev/null&&pwd -P`&&_cur=`pwd -P`&&[ -n "$${_bin}" ]&&[ "$${_cur#$${_bin}}" = "$${_cur}" ] ; then \ 147 test -z "$(cmtmsg)" || \ 148 echo "$(CMTMSGPREFIX)" "(Makefile.header) Removing binary directory $(bin)"; \ 149 \rm -rf $(bin) ; \ 150 fi 151 endif 152 136 153 # 137 154 # Display all targets 138 155 # 139 156 help :: 157 ifndef CMTBCAST 140 158 @echo '--------------------------------------------------------------------------' 141 159 @echo 'You may select one of the following make targets :' … … 160 178 @echo ' run all applications defined with the -check option' 161 179 @echo ' ' 162 163 164 # explicit rule not to remake 180 @echo 'To switch to BCAST mode, set CMTBCAST to non-empty string.' 181 else 182 @echo 'Targets for BCAST mode:' 183 @echo 184 @echo 'help : this help' 185 ifndef BCAST_ONLY 186 ifndef BCAST_GLOBAL 187 @echo 'all : (re)build all used packages in current project (this is default target)' 188 else 189 @echo 'all : (re)build all used packages in all projects (this is default target)' 190 endif 191 else 192 @echo 'all : (re)build current package (this is default target)' 193 endif 194 @echo 'clean : remove everything that can be rebuilt' 195 @echo 'binclean : fast erase of binary directories (and installation area)' 196 @echo 'uninstall : remove everything installed in the installation area' 197 @echo 198 ifndef BCAST_GLOBAL 199 @uses=`$(cmtexe) -private show macros '_project$$|package$$' -tag=$(tags)| \ 200 awk -F = '{if ($$1 ~ /_project$$/) {uses[substr($$1,1,length($$1)-8)]=$$2}else if ($$1 == "package") {cur = $$2;gsub("'\''","",cur)}}END{for (u in uses){if (uses[u]==uses[cur]) print u}}'`; \ 201 for u in $${uses}; do \ 202 echo "$${u} : (re)build package $${u} ($(_groups))"; \ 203 echo "$${u}clean : remove everything that can be rebuilt in package $${u}"; \ 204 echo "$${u}binclean : fast erase of binary directory in package $${u}"; \ 205 echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \ 206 done 207 else 208 @uses=`$(cmtexe) -private show macros '_root$$' -tag=$(tags)| \ 209 awk -F = '{u=substr($$1,1,length($$1)-5);if (u != "CMT" && u != "CMTHOME" && u != "CMTUSERCONTEXT") print u}'`; \ 210 for u in $${uses}; do \ 211 echo "$${u} : (re)build package $${u} ($(_groups))"; \ 212 echo "$${u}clean : remove everything that can be rebuilt in package $${u}"; \ 213 echo "$${u}binclean : fast erase of binary directory in package $${u}"; \ 214 echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \ 215 done 216 endif 217 @echo 218 ifndef BCAST_ONLY 219 @echo ' ... with dependencies packages (may be ignored by setting BCAST_ONLY).' 220 else 221 @echo ' ... without dependencies packages (may be included by unsetting BCAST_ONLY).' 222 endif 223 @echo 224 ifndef BCAST_GLOBAL 225 @echo 'To (re)build packages in all projects, set BCAST_GLOBAL.' 226 else 227 @echo 'To (re)build packages in current project, unset BCAST_GLOBAL.' 228 endif 229 ifndef NO_ALL_GROUPS 230 @echo 'To (re)build default group only, set NO_ALL_GROUPS.' 231 ifndef CMTACTIONS 232 @echo 'To also (re)build cmt_actions group, set CMTACTIONS.' 233 endif 234 else 235 @echo 'To (re)build all groups, unset NO_ALL_GROUPS.' 236 endif 237 @echo 238 @echo 'To switch to PACKAGE mode, unset CMTBCAST.' 239 endif 240 241 ifndef NO_ALL_GROUPS 242 ifndef CMTACTIONS 243 _groups = all groups except cmt_actions 244 else 245 _groups = all groups 246 endif 247 else 248 _groups = default group 249 endif 250 251 # explicit rule to avoid implicit rule search 252 # and not to remake 165 253 ${CMTROOT}/src/Makefile.header : ; 254 ${CMTROOT}/src/Makefile.core : ; 255 ifdef use_requirements 256 $(use_requirements) : ; 257 endif 166 258 167 259 # for multiple command line goals,
Note: See TracChangeset
for help on using the changeset viewer.