source: CMT/HEAD/mgr/fragments/constituent @ 638

Last change on this file since 638 was 631, checked in by rybkin, 11 years ago

See C.L. 502

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