comparison mk/objective.mk @ 287:eb768b801ab1 trunk

[svn] - add formal support for objective make overlays. this needs testing on BSD, but should work as I only used posix-compliant commands.
author nenolod
date Tue, 21 Nov 2006 22:09:05 -0800
parents 13389e613d67
children 0c8f475e0032
comparison
equal deleted inserted replaced
286:b8482261841d 287:eb768b801ab1
8 @for i in $(BINDIR) $(LIBDIR) $(INCLUDEDIR); do \ 8 @for i in $(BINDIR) $(LIBDIR) $(INCLUDEDIR); do \
9 if [ ! -d $(DESTDIR)/$$i ]; then \ 9 if [ ! -d $(DESTDIR)/$$i ]; then \
10 $(INSTALL) -d -m 755 $(DESTDIR)/$$i; \ 10 $(INSTALL) -d -m 755 $(DESTDIR)/$$i; \
11 fi; \ 11 fi; \
12 done; 12 done;
13 @if [ "x$(OVERLAYS)" != "x" ]; then \
14 for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
15 if [ $(VERBOSITY) -gt 0 ]; then \
16 echo "[installing overlay: $$i]"; \
17 fi; \
18 (pushd $$i > /dev/null; OVERLAYS="" $(MAKE) install || exit; cd ..); \
19 done; \
20 fi
13 @if [ "x$(SUBDIRS)" != "x" ]; then \ 21 @if [ "x$(SUBDIRS)" != "x" ]; then \
14 for i in $(SUBDIRS); do \ 22 for i in $(SUBDIRS); do \
15 if [ $(VERBOSITY) -gt 0 ]; then \ 23 if [ $(VERBOSITY) -gt 0 ]; then \
16 echo "[installing subobjective: $$i]"; \ 24 echo "[installing subobjective: $$i]"; \
17 fi; \ 25 fi; \
18 (cd $$i; $(MAKE) install || exit; cd ..); \ 26 (cd $$i; OVERLAYS="" $(MAKE) install || exit; cd ..); \
19 done; \ 27 done; \
20 fi 28 fi
21 @if [ "x$(OBJECTIVE_DIRECTORIES)" != "x" ]; then \ 29 @if [ "x$(OBJECTIVE_DIRECTORIES)" != "x" ]; then \
22 for i in $(OBJECTIVE_DIRECTORIES); do \ 30 for i in $(OBJECTIVE_DIRECTORIES); do \
23 printf "%10s %-20s\n" MKDIR $$i; \ 31 printf "%10s %-20s\n" MKDIR $$i; \
58 echo "[all objectives installed]"; \ 66 echo "[all objectives installed]"; \
59 fi 67 fi
60 68
61 clean: 69 clean:
62 $(MAKE) clean-prehook 70 $(MAKE) clean-prehook
71 @if [ "x$(OVERLAYS)" != "x" ]; then \
72 for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
73 if [ $(VERBOSITY) -gt 0 ]; then \
74 echo "[cleaning overlay: $$i]"; \
75 fi; \
76 (pushd $$i > /dev/null; OVERLAYS="" $(MAKE) clean || exit; popd); \
77 done; \
78 fi
63 @if [ "x$(SUBDIRS)" != "x" ]; then \ 79 @if [ "x$(SUBDIRS)" != "x" ]; then \
64 for i in $(SUBDIRS); do \ 80 for i in $(SUBDIRS); do \
65 if [ $(VERBOSITY) -gt 0 ]; then \ 81 if [ $(VERBOSITY) -gt 0 ]; then \
66 echo "[cleaning subobjective: $$i]"; \ 82 echo "[cleaning subobjective: $$i]"; \
67 fi; \ 83 fi; \
68 (cd $$i; $(MAKE) clean || exit; cd ..); \ 84 (cd $$i; OVERLAYS="" $(MAKE) clean || exit; cd ..); \
69 done; \ 85 done; \
70 fi 86 fi
71 $(MAKE) clean-posthook 87 $(MAKE) clean-posthook
72 rm -f *.o *.lo *.so *.a *.sl 88 rm -f *.o *.lo *.so *.a *.sl
73 @if [ "x$(OBJECTIVE_BINS)" != "x" ]; then \ 89 @if [ "x$(OBJECTIVE_BINS)" != "x" ]; then \
88 @if [ $(VERBOSITY) -gt 0 ]; then \ 104 @if [ $(VERBOSITY) -gt 0 ]; then \
89 echo "[all objectives cleaned]"; \ 105 echo "[all objectives cleaned]"; \
90 fi 106 fi
91 107
92 distclean: clean 108 distclean: clean
109 @if [ "x$(OVERLAYS)" != "x" ]; then \
110 for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
111 if [ $(VERBOSITY) -gt 0 ]; then \
112 echo "[distcleaning overlay: $$i]"; \
113 fi; \
114 (pushd $$i > /dev/null; OVERLAYS="" $(MAKE) distclean || exit; popd); \
115 done; \
116 fi
93 @if [ "x$(SUBDIRS)" != "x" ]; then \ 117 @if [ "x$(SUBDIRS)" != "x" ]; then \
94 for i in $(SUBDIRS); do \ 118 for i in $(SUBDIRS); do \
95 if [ $(VERBOSITY) -gt 0 ]; then \ 119 if [ $(VERBOSITY) -gt 0 ]; then \
96 echo "[distcleaning subobjective: $$i]"; \ 120 echo "[distcleaning subobjective: $$i]"; \
97 fi; \ 121 fi; \
98 (cd $$i; $(MAKE) distclean || exit; cd ..); \ 122 (cd $$i; OVERLAYS="" $(MAKE) distclean || exit; cd ..); \
99 done; \ 123 done; \
100 fi 124 fi
101 @if [ -f Makefile.in ]; then \ 125 @if [ -f Makefile.in ]; then \
102 rm -f Makefile; \ 126 rm -f Makefile; \
103 fi 127 fi
105 rm -f mk/rules.mk; \ 129 rm -f mk/rules.mk; \
106 fi 130 fi
107 131
108 build: 132 build:
109 $(MAKE) build-prehook 133 $(MAKE) build-prehook
134 @if [ "x$(OVERLAYS)" != "x" ]; then \
135 for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
136 if [ $(VERBOSITY) -gt 0 ]; then \
137 echo "[building overlay: $$i]"; \
138 fi; \
139 (pushd $$i > /dev/null; OVERLAYS="" $(MAKE) || exit; popd); \
140 if [ $(VERBOSITY) -gt 0 ]; then \
141 echo "[finished overlay: $$i]"; \
142 fi; \
143 done; \
144 fi
110 @if [ "x$(SUBDIRS)" != "x" ]; then \ 145 @if [ "x$(SUBDIRS)" != "x" ]; then \
111 for i in $(SUBDIRS); do \ 146 for i in $(SUBDIRS); do \
112 if [ $(VERBOSITY) -gt 0 ]; then \ 147 if [ $(VERBOSITY) -gt 0 ]; then \
113 echo "[building subobjective: $$i]"; \ 148 echo "[building subobjective: $$i]"; \
114 fi; \ 149 fi; \
115 cd $$i; $(MAKE) || exit; cd ..; \ 150 (cd $$i; OVERLAYS="" $(MAKE) || exit; cd ..); \
116 if [ $(VERBOSITY) -gt 0 ]; then \ 151 if [ $(VERBOSITY) -gt 0 ]; then \
117 echo "[finished subobjective: $$i]"; \ 152 echo "[finished subobjective: $$i]"; \
118 fi; \ 153 fi; \
119 done; \ 154 done; \
120 fi 155 fi