1 | #-- start of constituent ------ |
---|
2 | |
---|
3 | cmt_${CONSTITUENT}_${HASTARGETTAG} = 1 |
---|
4 | |
---|
5 | #-------------------------------------- |
---|
6 | |
---|
7 | ifdef cmt_${CONSTITUENT}_has_target_tag |
---|
8 | |
---|
9 | cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag)_${CONSTITUENT}.make |
---|
10 | cmt_final_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}.make |
---|
11 | cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make |
---|
12 | |
---|
13 | ${CONSTITUENT}_extratags = -tag_add=target_${CONSTITUENT} |
---|
14 | |
---|
15 | else |
---|
16 | |
---|
17 | cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag).make |
---|
18 | cmt_final_setup_${CONSTITUENT} = $(bin)setup.make |
---|
19 | cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make |
---|
20 | |
---|
21 | endif |
---|
22 | |
---|
23 | not_${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 | |
---|
25 | ifdef STRUCTURED_OUTPUT |
---|
26 | ${CONSTITUENT}dirs : |
---|
27 | @if test ! -d $(bin)${CONSTITUENT}; then $(mkdir) -p $(bin)${CONSTITUENT}; fi |
---|
28 | $(echo) "STRUCTURED_OUTPUT="$(bin)${CONSTITUENT} |
---|
29 | else |
---|
30 | ${CONSTITUENT}dirs : ; |
---|
31 | endif |
---|
32 | |
---|
33 | ifdef cmt_${CONSTITUENT}_has_target_tag |
---|
34 | |
---|
35 | ifndef 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} |
---|
39 | else |
---|
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 |
---|
48 | endif |
---|
49 | |
---|
50 | else |
---|
51 | |
---|
52 | ifndef 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} |
---|
56 | else |
---|
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 |
---|
65 | endif |
---|
66 | |
---|
67 | endif |
---|
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 | |
---|
79 | clean :: ${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 | |
---|
91 | install :: ${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 | |
---|
101 | uninstall : ${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 | |
---|
113 | remove_library_links :: ${CONSTITUENT}uninstall ; |
---|
114 | |
---|
115 | ifndef PEDANTIC |
---|
116 | .DEFAULT:: |
---|
117 | $(echo) "(constituents.make) Starting $@ ${CONSTITUENT}" |
---|
118 | $(echo) Using default action for $@ |
---|
119 | $(echo) "(constituents.make) $@ ${CONSTITUENT} done" |
---|
120 | endif |
---|
121 | |
---|
122 | #-- end of constituent ------ |
---|