source: CMT/HEAD/mgr/fragments/constituent_app_lib @ 628

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

See C.L. 499

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