[2] | 1 | #-- start of constituent ------ |
---|
| 2 | |
---|
| 3 | cmt_${CONSTITUENT}_${HASTARGETTAG} = 1 |
---|
| 4 | |
---|
| 5 | #-------------------------------------------------------- |
---|
| 6 | |
---|
| 7 | ifdef cmt_${CONSTITUENT}_has_target_tag |
---|
| 8 | |
---|
[434] | 9 | #cmt_local_tagfile_${CONSTITUENT} = $(${PACKAGE}_tag)_${CONSTITUENT}.make |
---|
| 10 | cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag)_${CONSTITUENT}.make |
---|
[487] | 11 | cmt_local_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}$$$$.make |
---|
| 12 | cmt_final_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}.make |
---|
| 13 | #cmt_final_setup_${CONSTITUENT} = $(bin)${PACKAGE}_${CONSTITUENT}setup.make |
---|
[2] | 14 | cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make |
---|
| 15 | |
---|
| 16 | ${CONSTITUENT}_extratags = -tag_add=target_${CONSTITUENT} |
---|
| 17 | |
---|
[434] | 18 | #$(cmt_local_tagfile_${CONSTITUENT}) : $(cmt_lock_setup) |
---|
| 19 | ifndef QUICK |
---|
| 20 | $(cmt_local_tagfile_${CONSTITUENT}) :: |
---|
| 21 | else |
---|
| 22 | $(cmt_local_tagfile_${CONSTITUENT}) : |
---|
| 23 | endif |
---|
[487] | 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 |
---|
[2] | 35 | |
---|
| 36 | else |
---|
| 37 | |
---|
[434] | 38 | #cmt_local_tagfile_${CONSTITUENT} = $(${PACKAGE}_tag).make |
---|
| 39 | cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag).make |
---|
[487] | 40 | cmt_final_setup_${CONSTITUENT} = $(bin)setup.make |
---|
| 41 | #cmt_final_setup_${CONSTITUENT} = $(bin)${PACKAGE}setup.make |
---|
[2] | 42 | cmt_local_${CONSTITUENT}_makefile = $(bin)${CONSTITUENT}.make |
---|
| 43 | |
---|
| 44 | endif |
---|
| 45 | |
---|
[588] | 46 | 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 ]; } |
---|
| 47 | |
---|
[483] | 48 | ifdef STRUCTURED_OUTPUT |
---|
[487] | 49 | ${CONSTITUENT}dirs : |
---|
[483] | 50 | @if test ! -d $(bin)${CONSTITUENT}; then $(mkdir) -p $(bin)${CONSTITUENT}; fi |
---|
| 51 | $(echo) "STRUCTURED_OUTPUT="$(bin)${CONSTITUENT} |
---|
| 52 | else |
---|
[487] | 53 | ${CONSTITUENT}dirs : ; |
---|
[483] | 54 | endif |
---|
[487] | 55 | |
---|
| 56 | #ifndef QUICK |
---|
| 57 | #ifdef STRUCTURED_OUTPUT |
---|
| 58 | # ${CONSTITUENT}dirs :: |
---|
| 59 | # @if test ! -d $(bin)${CONSTITUENT}; then $(mkdir) -p $(bin)${CONSTITUENT}; fi |
---|
| 60 | # $(echo) "STRUCTURED_OUTPUT="$(bin)${CONSTITUENT} |
---|
| 61 | # |
---|
| 62 | #$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links dirs ${CONSTITUENT}dirs |
---|
| 63 | #else |
---|
| 64 | #$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links dirs |
---|
| 65 | #endif |
---|
| 66 | #else |
---|
| 67 | #$(cmt_local_${CONSTITUENT}_makefile) :: $(cmt_local_tagfile_${CONSTITUENT}) |
---|
| 68 | #endif |
---|
| 69 | |
---|
[561] | 70 | ifdef cmt_${CONSTITUENT}_has_target_tag |
---|
[488] | 71 | |
---|
[492] | 72 | ifndef QUICK |
---|
[547] | 73 | $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) build_library_links |
---|
| 74 | $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \ |
---|
| 75 | $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT} |
---|
[492] | 76 | else |
---|
[588] | 77 | $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_build_library_linksstamp) $(use_requirements) |
---|
| 78 | @if [ ! -f $@ ] || [ ! -f $(cmt_local_tagfile_${CONSTITUENT}) ] || \ |
---|
| 79 | [ ! -f $(cmt_final_setup_${CONSTITUENT}) ] || \ |
---|
| 80 | $(not_${CONSTITUENT}_dependencies) ; then \ |
---|
[547] | 81 | test -z "$(cmtmsg)" || \ |
---|
| 82 | echo "$(CMTMSGPREFIX)" "(constituents.make) Building ${CONSTITUENT}.make"; \ |
---|
| 83 | $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \ |
---|
| 84 | fi |
---|
[492] | 85 | endif |
---|
[2] | 86 | |
---|
[561] | 87 | else |
---|
| 88 | |
---|
| 89 | ifndef QUICK |
---|
| 90 | $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) build_library_links |
---|
| 91 | $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \ |
---|
| 92 | $(cmtexe) -f=$(bin)${CONSTITUENT}.in -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -without_cmt -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT} |
---|
| 93 | else |
---|
[588] | 94 | $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_build_library_linksstamp) $(bin)${CONSTITUENT}.in |
---|
| 95 | @if [ ! -f $@ ] || [ ! -f $(cmt_local_tagfile_${CONSTITUENT}) ] || \ |
---|
| 96 | [ ! -f $(cmt_final_setup_${CONSTITUENT}) ] || \ |
---|
| 97 | $(not_${CONSTITUENT}_dependencies) ; then \ |
---|
[561] | 98 | test -z "$(cmtmsg)" || \ |
---|
| 99 | echo "$(CMTMSGPREFIX)" "(constituents.make) Building ${CONSTITUENT}.make"; \ |
---|
| 100 | $(cmtexe) -f=$(bin)${CONSTITUENT}.in -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -without_cmt -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \ |
---|
| 101 | fi |
---|
| 102 | endif |
---|
| 103 | |
---|
| 104 | endif |
---|
| 105 | |
---|
[547] | 106 | # $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT} |
---|
| 107 | |
---|
[487] | 108 | ${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs |
---|
[441] | 109 | $(echo) "(constituents.make) Starting ${CONSTITUENT}" |
---|
[588] | 110 | @if test -f $(cmt_local_${CONSTITUENT}_makefile); then \ |
---|
| 111 | $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \ |
---|
| 112 | fi |
---|
| 113 | # @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT} |
---|
[441] | 114 | $(echo) "(constituents.make) ${CONSTITUENT} done" |
---|
[2] | 115 | |
---|
| 116 | clean :: ${CONSTITUENT}clean |
---|
| 117 | |
---|
[492] | 118 | ${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile) |
---|
[441] | 119 | $(echo) "(constituents.make) Starting ${CONSTITUENT}clean" |
---|
[492] | 120 | @-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \ |
---|
| 121 | $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean; \ |
---|
| 122 | fi |
---|
[487] | 123 | $(echo) "(constituents.make) ${CONSTITUENT}clean done" |
---|
[492] | 124 | # @-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean |
---|
[2] | 125 | |
---|
| 126 | ## /bin/rm -f $(cmt_local_${CONSTITUENT}_makefile) $(bin)${CONSTITUENT}_dependencies.make |
---|
| 127 | |
---|
| 128 | install :: ${CONSTITUENT}install |
---|
| 129 | |
---|
| 130 | ${CONSTITUENT}install :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) |
---|
[441] | 131 | $(echo) "(constituents.make) Starting install ${CONSTITUENT}" |
---|
[487] | 132 | @-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) install |
---|
[441] | 133 | $(echo) "(constituents.make) install ${CONSTITUENT} done" |
---|
[2] | 134 | |
---|
[588] | 135 | uninstall : ${CONSTITUENT}uninstall |
---|
[2] | 136 | |
---|
[492] | 137 | $(foreach d,$(${CONSTITUENT}_dependencies),$(eval $(d)uninstall_dependencies += ${CONSTITUENT}uninstall)) |
---|
| 138 | |
---|
[588] | 139 | ${CONSTITUENT}uninstall : $(${CONSTITUENT}uninstall_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile) |
---|
[441] | 140 | $(echo) "(constituents.make) Starting uninstall ${CONSTITUENT}" |
---|
[588] | 141 | @if test -f $(cmt_local_${CONSTITUENT}_makefile); then \ |
---|
| 142 | $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall; \ |
---|
| 143 | fi |
---|
| 144 | # @$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall |
---|
[441] | 145 | $(echo) "(constituents.make) uninstall ${CONSTITUENT} done" |
---|
[2] | 146 | |
---|
[588] | 147 | remove_library_links :: ${CONSTITUENT}uninstall |
---|
| 148 | |
---|
[183] | 149 | ifndef PEDANTIC |
---|
[2] | 150 | .DEFAULT:: |
---|
[441] | 151 | $(echo) "(constituents.make) Starting $@ ${CONSTITUENT}" |
---|
| 152 | $(echo) Using default action for $@ |
---|
| 153 | $(echo) "(constituents.make) $@ ${CONSTITUENT} done" |
---|
[183] | 154 | endif |
---|
[2] | 155 | |
---|
| 156 | #-- end of constituent ------ |
---|