source: CMT/HEAD/mgr/fragments/constituent_app_lib

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

See C.L. 502

File size: 5.6 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
72${CONSTITUENT} :: ${CONSTITUENT}compile ${CONSTITUENT}install ;
73
74ifdef cmt_${CONSTITUENT}_has_prototypes
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
86endif
87
88${CONSTITUENT}compile : $(${CONSTITUENT}compile_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
89        $(echo) "(constituents.make) Starting $@"
90        @if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
91          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@; \
92          fi
93#       @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@
94        $(echo) "(constituents.make) $@ done"
95
96clean :: ${CONSTITUENT}clean ;
97
98${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
99        $(echo) "(constituents.make) Starting $@"
100        @-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
101          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@; \
102        fi
103        $(echo) "(constituents.make) $@ 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}compile $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
111        $(echo) "(constituents.make) Starting $@"
112        @if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
113          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@; \
114          fi
115#       @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@
116        $(echo) "(constituents.make) $@ done"
117
118uninstall : ${CONSTITUENT}uninstall
119
120$(foreach d,$(${CONSTITUENT}_dependencies),$(eval $(d)uninstall_dependencies += ${CONSTITUENT}uninstall))
121
122${CONSTITUENT}uninstall : $(${CONSTITUENT}uninstall_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
123        $(echo) "(constituents.make) Starting $@"
124        @-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
125          $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall; \
126          fi
127#       @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall
128        $(echo) "(constituents.make) $@ done"
129
130remove_library_links :: ${CONSTITUENT}uninstall ;
131
132ifndef PEDANTIC
133.DEFAULT::
134        $(echo) "(constituents.make) Starting $@ ${CONSTITUENT}"
135        $(echo) Using default action for $@
136        $(echo) "(constituents.make) $@ ${CONSTITUENT} done"
137endif
138
139#-- end of constituent_app_lib ------
Note: See TracBrowser for help on using the repository browser.