source: CMT/HEAD/mgr/fragments/constituent_lock @ 547

Last change on this file since 547 was 547, checked in by rybkin, 14 years ago

See C.L. 432

File size: 5.8 KB
Line 
1#-- start of constituent_lock ------
2
3cmt_${CONSTITUENT}_${HASTARGETTAG} = 1
4
5#--------------------------------------------------------
6
7ifdef cmt_${CONSTITUENT}_has_target_tag
8
9#cmt_local_tagfile_${CONSTITUENT} = $(${PACKAGE}_tag)_${CONSTITUENT}.make
10cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag)_${CONSTITUENT}.make
11cmt_local_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}$$$$.make
12cmt_final_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}.make
13#cmt_final_setup_${CONSTITUENT} = $(bin)${PACKAGE}_${CONSTITUENT}setup.make
14cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make
15
16${CONSTITUENT}_extratags = -tag_add=target_${CONSTITUENT}
17
18#$(cmt_local_tagfile_${CONSTITUENT}) : $(cmt_lock_setup)
19ifndef QUICK
20$(cmt_local_tagfile_${CONSTITUENT}) ::
21else
22$(cmt_local_tagfile_${CONSTITUENT}) :
23endif
24        $(echo) "(constituents.make) Rebuilding $@"; \
25          if test -f $(cmt_local_tagfile_${CONSTITUENT}); then /bin/rm -f $(cmt_local_tagfile_${CONSTITUENT}); fi ; \
26          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >>$(cmt_local_tagfile_${CONSTITUENT})
27        $(echo) "(constituents.make) Rebuilding $(cmt_final_setup_${CONSTITUENT})"; \
28          test ! -f $(cmt_local_setup_${CONSTITUENT}) || \rm -f $(cmt_local_setup_${CONSTITUENT}); \
29          trap '\rm -f $(cmt_local_setup_${CONSTITUENT})' 0 1 2 15; \
30          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT}) && \
31          if [ -f $(cmt_final_setup_${CONSTITUENT}) ] && \
32            \cmp -s $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}); then \
33            \rm $(cmt_local_setup_${CONSTITUENT}); else \
34            \mv -f $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}); fi
35
36else
37
38#cmt_local_tagfile_${CONSTITUENT} = $(${PACKAGE}_tag).make
39cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag).make
40cmt_final_setup_${CONSTITUENT} = $(bin)setup.make
41#cmt_final_setup_${CONSTITUENT} = $(bin)${PACKAGE}setup.make
42cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make
43
44endif
45
46ifdef STRUCTURED_OUTPUT
47${CONSTITUENT}dirs :
48        @if test ! -d $(bin)${CONSTITUENT}; then $(mkdir) -p $(bin)${CONSTITUENT}; fi
49        $(echo) "STRUCTURED_OUTPUT="$(bin)${CONSTITUENT}
50else
51${CONSTITUENT}dirs : ;
52endif
53
54#ifndef QUICK
55#ifdef STRUCTURED_OUTPUT
56# ${CONSTITUENT}dirs ::
57#       @if test ! -d $(bin)${CONSTITUENT}; then $(mkdir) -p $(bin)${CONSTITUENT}; fi
58#       $(echo) "STRUCTURED_OUTPUT="$(bin)${CONSTITUENT}
59#
60#$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links dirs ${CONSTITUENT}dirs
61#else
62#$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links dirs
63#endif
64#else
65#$(cmt_local_${CONSTITUENT}_makefile) :: $(cmt_local_tagfile_${CONSTITUENT})
66#endif
67
68makefiles : $(cmt_local_${CONSTITUENT}_makefile)
69
70ifndef QUICK
71$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) build_library_links
72#$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
73        $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
74          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
75else
76$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies)
77#$(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
78        if [ ! -f $@ ]; then \
79          test -z "$(cmtmsg)" || \
80          echo "$(CMTMSGPREFIX)" "(constituents.make) Building ${CONSTITUENT}.make"; \
81          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \
82          fi
83endif
84
85#         $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
86
87${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
88        $(echo) "(constituents.make) Creating ${CONSTITUENT}${lock_suffix} and Starting ${CONSTITUENT}"
89        @${lock_command} ${CONSTITUENT}${lock_suffix} || exit $$?; \
90          retval=$$?; \
91          trap '${unlock_command} ${CONSTITUENT}${lock_suffix}; exit $${retval}' 1 2 15; \
92          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \
93          retval=$$?; ${unlock_command} ${CONSTITUENT}${lock_suffix}; exit $${retval}
94        $(echo) "(constituents.make) ${CONSTITUENT} done"
95
96clean :: ${CONSTITUENT}clean
97
98${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
99        $(echo) "(constituents.make) Starting ${CONSTITUENT}clean"
100        @-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
101          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean; \
102        fi
103        $(echo) "(constituents.make) ${CONSTITUENT}clean done"
104#       @-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
105
106##        /bin/rm -f $(cmt_local_${CONSTITUENT}_makefile) $(bin)${CONSTITUENT}_dependencies.make
107
108install :: ${CONSTITUENT}install
109
110${CONSTITUENT}install :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
111        $(echo) "(constituents.make) Starting install ${CONSTITUENT}"
112        @-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) install
113        $(echo) "(constituents.make) install ${CONSTITUENT} done"
114
115uninstall :: ${CONSTITUENT}uninstall
116
117$(foreach d,$(${CONSTITUENT}_dependencies),$(eval $(d)uninstall_dependencies += ${CONSTITUENT}uninstall))
118
119${CONSTITUENT}uninstall :: $(${CONSTITUENT}uninstall_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
120        $(echo) "(constituents.make) Starting uninstall ${CONSTITUENT}"
121        @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall
122        $(echo) "(constituents.make) uninstall ${CONSTITUENT} done"
123
124ifndef PEDANTIC
125.DEFAULT::
126        $(echo) "(constituents.make) Starting $@ ${CONSTITUENT}"
127        $(echo) Using default action for $@
128        $(echo) "(constituents.make) $@ ${CONSTITUENT} done"
129endif
130
131#-- end of constituent_lock ------
Note: See TracBrowser for help on using the repository browser.