source: CMT/v1r14p20031120/src/Makefile.header @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 2.8 KB
Line 
1
2include ${CMTROOT}/src/Makefile.core
3
4#
5#  Basic tag management
6#
7ifdef tag
8CMTEXTRATAGS = $(tag)
9else
10tag       = $(CMTCONFIG)
11endif
12
13tags      = $(CMTEXTRATAGS)
14
15#
16#  Generic entry points for all targets
17#
18all ::
19        @$(cmtexe) check configuration
20        @/bin/rm -f $(tag).make
21        @$(MAKE) --no-print-directory $(MAKEFLAGS) target="first config all" common_target
22
23binclean ::
24        @if test ! "$(bin)" = "./"; then \
25          if test -d $(bin) ; then \
26            echo "------> (Makefile.header) Cleaning all from $(bin)"; \
27            /bin/rm -rf $(bin) ; \
28          fi ; \
29        fi
30
31clean ::
32        @$(cmtexe) check configuration
33        @$(MAKE) --no-print-directory target="$@" common_target
34
35.DEFAULT ::
36        @$(cmtexe) check configuration
37        @$(MAKE) --no-print-directory target="config $@" common_target
38
39#
40#  Capture all possible targets
41#
42common_target ::
43        @cmt_lock_pid=`mktemp /tmp/CMTXXXXXX | sed -e 's#/tmp/CMT##'`; \
44          rm -f /tmp/CMT$${cmt_lock_pid}; \
45          temp_lock=/tmp/lock$${cmt_lock_pid}.make; \
46          temp_constituents=/tmp/constituents$${cmt_lock_pid}; \
47          if test ! "${CMTMAKEDEBUG}" = 1; then\
48            trap '/bin/rm -f $${temp_lock} $${temp_constituents}; exit $${status}' 0 1 2 15; \
49          fi; \
50          /bin/rm -f $${temp_lock}; \
51          echo "------> (Makefile.header) Rebuilding constituents.make"; \
52          $(cmtexe) build constituents_makefile -quiet -tag=$(tags); \
53          /bin/mv constituents.make $${temp_constituents}; \
54          /bin/rm -f $(tag).make; \
55          $(MAKE) --no-print-directory -f $${temp_constituents} cmt_lock_pid=$${cmt_lock_pid} $(target); \
56          status=$$?; \
57          exit $${status}
58
59
60#
61#  Ancient mechanism for remote launchers (kept for backward compatibility)
62#
63$(gmake_hosts) ::
64        rsh $@ "sh -c '(cd `$(cmtexe) show pwd -quiet`; . setup.sh; gmake $(MAKEFLAGS) $(target))'"
65
66$(make_hosts) ::
67        rsh $@ "sh -c '(cd `$(cmtexe) show pwd`; . setup.sh; make $(MAKEFLAGS) $(target))'"
68
69
70everywhere :: $(everywhere)
71
72#
73#   Display all targets
74#
75help ::
76        @echo '--------------------------------------------------------------------------'
77        @echo 'You may select one of the following make targets :'
78        @echo ' '
79        @echo 'help        : this help'
80        @echo 'all         : rebuild all constituents according to the $$(constituents) macro'
81        @echo '              (this is the default target)'
82        @echo 'clean       : remove everything that can be rebuilt'
83        @echo 'binclean    : fast erase of the binary directory'
84        @echo ' '
85        @groups=`$(cmtexe) show groups -quiet -tag=$(tags)`; \
86          for g in $${groups}; do \
87            echo "$${g} : rebuild all constituents of group $${g}"; \
88          done
89        @echo "Constituents:"; \
90          for c in `$(cmtexe) show constituent_names -quiet -tag=$(tags)` ; do \
91            echo "  $${c}  $${c}clean"; \
92          done
93        @echo ' '
94        @echo 'check :'
95        @echo '              run all applications defined with the -check option'
96        @echo ' '
97
98
Note: See TracBrowser for help on using the repository browser.