include ${CMTROOT}/src/Makefile.core # # Basic tag management # ifdef tag CMTEXTRATAGS = $(tag) else tag = $(CMTCONFIG) endif tags = $(CMTEXTRATAGS) # # Generic entry points for all targets # all :: @$(cmtexe) check configuration @/bin/rm -f $(tag).make @$(MAKE) --no-print-directory $(MAKEFLAGS) target="first config all" common_target binclean :: @if test ! "$(bin)" = "./"; then \ if test -d $(bin) ; then \ echo "------> (Makefile.header) Cleaning all from $(bin)"; \ /bin/rm -rf $(bin) ; \ fi ; \ fi clean :: @$(cmtexe) check configuration @$(MAKE) --no-print-directory target="$@" common_target .DEFAULT :: @$(cmtexe) check configuration @$(MAKE) --no-print-directory target="config $@" common_target # # Capture all possible targets # common_target :: @cmt_lock_pid=`mktemp /tmp/CMTXXXXXX | sed -e 's#/tmp/CMT##'`; \ rm -f /tmp/CMT$${cmt_lock_pid}; \ temp_lock=/tmp/lock$${cmt_lock_pid}.make; \ temp_constituents=/tmp/constituents$${cmt_lock_pid}; \ if test ! "${CMTMAKEDEBUG}" = 1; then\ trap '/bin/rm -f $${temp_lock} $${temp_constituents}; exit $${status}' 0 1 2 15; \ fi; \ /bin/rm -f $${temp_lock}; \ echo "------> (Makefile.header) Rebuilding constituents.make"; \ $(cmtexe) build constituents_makefile -quiet -tag=$(tags); \ /bin/mv constituents.make $${temp_constituents}; \ /bin/rm -f $(tag).make; \ $(MAKE) --no-print-directory -f $${temp_constituents} cmt_lock_pid=$${cmt_lock_pid} $(target); \ status=$$?; \ exit $${status} # # Ancient mechanism for remote launchers (kept for backward compatibility) # $(gmake_hosts) :: rsh $@ "sh -c '(cd `$(cmtexe) show pwd -quiet`; . setup.sh; gmake $(MAKEFLAGS) $(target))'" $(make_hosts) :: rsh $@ "sh -c '(cd `$(cmtexe) show pwd`; . setup.sh; make $(MAKEFLAGS) $(target))'" everywhere :: $(everywhere) # # Display all targets # help :: @echo '--------------------------------------------------------------------------' @echo 'You may select one of the following make targets :' @echo ' ' @echo 'help : this help' @echo 'all : rebuild all constituents according to the $$(constituents) macro' @echo ' (this is the default target)' @echo 'clean : remove everything that can be rebuilt' @echo 'binclean : fast erase of the binary directory' @echo ' ' @groups=`$(cmtexe) show groups -quiet -tag=$(tags)`; \ for g in $${groups}; do \ echo "$${g} : rebuild all constituents of group $${g}"; \ done @echo "Constituents:"; \ for c in `$(cmtexe) show constituent_names -quiet -tag=$(tags)` ; do \ echo " $${c} $${c}clean"; \ done @echo ' ' @echo 'check :' @echo ' run all applications defined with the -check option' @echo ' '