Mercurial > audlegacy-plugins
annotate buildsys.mk.in @ 1984:489e32a8e106
change some places to use set_params() instead of set_info() directly
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 07 Oct 2007 14:19:19 -0500 |
parents | f86cb7fc1d4f |
children | 422b20698db5 |
rev | line source |
---|---|
1763 | 1 # |
2 # Copyright (c) 2007, Jonathan Schleifer <js@h3c.de> | |
3 # | |
4 # Permission to use, copy, modify, and/or distribute this software for any | |
5 # purpose with or without fee is hereby granted, provided that the above | |
6 # copyright notice and this permission notice is present in all copies. | |
7 # | |
8 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
9 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
10 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
11 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
12 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
13 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
14 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
15 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
16 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
17 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
18 # POSSIBILITY OF SUCH DAMAGE. | |
19 # | |
20 | |
21 PACKAGE = @PACKAGE@ | |
22 CC = @CC@ | |
23 CXX = @CXX@ | |
24 CPP = @CPP@ | |
25 DC = @DC@ | |
26 ERLC = @ERLC@ | |
27 OBJC = @OBJC@ | |
28 AR = @AR@ | |
29 LD = ${CC} | |
30 CFLAGS = @CFLAGS@ | |
31 CXXFLAGS = @CXXFLAGS@ | |
32 CPPFLAGS = @CPPFLAGS@ | |
33 DFLAGS = @DFLAGS@ | |
34 ERLCFLAGS = @ERLCFLAGS@ | |
35 OBJCFLAGS = @OBJCFLAGS@ | |
36 LDFLAGS = @LDFLAGS@ | |
37 LIBS = @LIBS@ | |
1909 | 38 PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@ |
39 PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@ | |
1879
81cdc01db60e
Update buildsys (adds ${PROG_SUFFIX}).
Jonathan Schleifer <js@h3c.de>
parents:
1877
diff
changeset
|
40 PROG_SUFFIX = @EXEEXT@ |
1763 | 41 LIB_CPPFLAGS = @LIB_CPPFLAGS@ |
42 LIB_CFLAGS = @LIB_CFLAGS@ | |
43 LIB_LDFLAGS = @LIB_LDFLAGS@ | |
44 LIB_PREFIX = @LIB_PREFIX@ | |
45 LIB_SUFFIX = @LIB_SUFFIX@ | |
46 PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ | |
47 PLUGIN_CFLAGS = @PLUGIN_CFLAGS@ | |
48 PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ | |
49 PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ | |
50 INSTALL_LIB = @INSTALL_LIB@ | |
51 UNINSTALL_LIB = @UNINSTALL_LIB@ | |
52 CLEAN_LIB = @CLEAN_LIB@ | |
53 LN_S = @LN_S@ | |
54 MKDIR_P = mkdir -p | |
1863 | 55 INSTALL = install |
1763 | 56 SHELL = @SHELL@ |
57 prefix = @prefix@ | |
58 exec_prefix = @exec_prefix@ | |
59 bindir = @bindir@ | |
60 libdir = @libdir@ | |
61 plugindir ?= ${PACKAGE} | |
62 datarootdir = @datarootdir@ | |
63 datadir = @datadir@ | |
64 includedir = @includedir@ | |
65 includesubdir ?= ${PACKAGE} | |
66 mandir = @mandir@ | |
67 mansubdir ?= man1 | |
68 | |
69 OBJS1 = ${SRCS:.c=.o} | |
70 OBJS2 = ${OBJS1:.cc=.o} | |
71 OBJS3 = ${OBJS2:.cxx=.o} | |
72 OBJS4 = ${OBJS3:.d=.o} | |
73 OBJS5 = ${OBJS4:.erl=.beam} | |
74 OBJS += ${OBJS5:.m=.o} | |
75 | |
76 .SILENT: | |
77 .SUFFIXES: .beam .c .cc .cxx .d .erl .m | |
1909 | 78 .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean |
1763 | 79 |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
80 all: |
1868 | 81 for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \ |
1845 | 82 ${MAKE} ${MFLAGS} $$i || exit 1; \ |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
83 done |
1763 | 84 |
85 subdirs: | |
86 for i in ${SUBDIRS}; do \ | |
87 ${DIR_ENTER}; \ | |
88 ${MAKE} ${MFLAGS} || exit 1; \ | |
89 ${DIR_LEAVE}; \ | |
90 done | |
91 | |
92 depend: pre-depend ${SRCS} | |
93 regen=0; \ | |
1865 | 94 for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ |
95 if test x"$$regen" = x"1"; then \ | |
1881
8bdede3414cd
Optimize dependency generation.
Jonathan Schleifer <js@h3c.de>
parents:
1879
diff
changeset
|
96 list=""; \ |
1815 | 97 ${DEPEND_STATUS}; \ |
1763 | 98 for i in ${SRCS}; do \ |
99 case $${i##*.} in \ | |
100 c|cc|cxx|m) \ | |
1881
8bdede3414cd
Optimize dependency generation.
Jonathan Schleifer <js@h3c.de>
parents:
1879
diff
changeset
|
101 list="$$list $$i"; \ |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
102 ;; \ |
1763 | 103 esac; \ |
104 done; \ | |
1909 | 105 if test x"$$list" != "x"; then \ |
106 if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \ | |
107 ${DEPEND_OK}; \ | |
108 else \ | |
109 ${DEPEND_FAILED}; \ | |
110 fi; \ | |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
111 fi; \ |
1763 | 112 fi |
113 | |
114 pre-depend: | |
115 | |
1815 | 116 ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} |
1763 | 117 ${LINK_STATUS} |
118 if ${LD} -o $@ ${OBJS} ${LDFLAGS} ${LIBS}; then \ | |
119 ${LINK_OK}; \ | |
120 else \ | |
121 ${LINK_FAILED}; \ | |
122 fi | |
123 | |
124 ${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${OBJS} | |
125 ${LINK_STATUS} | |
126 if ${LD} -o $@ ${OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ | |
127 ${LINK_OK}; \ | |
128 else \ | |
129 ${LINK_FAILED}; \ | |
130 fi | |
131 | |
132 ${PLUGIN} ${PLUGIN_NONST}: ${EXT_DEPS} ${OBJS} | |
133 ${LINK_STATUS} | |
134 if ${LD} -o $@ ${OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ | |
135 ${LINK_OK}; \ | |
136 else \ | |
137 ${LINK_FAILED}; \ | |
138 fi | |
139 | |
140 ${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} | |
141 ${LINK_STATUS} | |
142 if ${AR} cr $@ ${OBJS}; then \ | |
143 ${LINK_OK}; \ | |
144 else \ | |
145 ${LINK_FAILED}; \ | |
146 fi | |
147 | |
148 .c.o: | |
149 ${COMPILE_STATUS} | |
150 if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
151 ${COMPILE_OK}; \ | |
152 else \ | |
153 ${COMPILE_FAILED}; \ | |
154 fi | |
155 | |
156 .cc.o .cxx.o: | |
157 ${COMPILE_STATUS} | |
158 if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
159 ${COMPILE_OK}; \ | |
160 else \ | |
161 ${COMPILE_FAILED}; \ | |
162 fi | |
163 | |
164 .d.o: | |
165 ${COMPILE_STATUS} | |
1865 | 166 if test x"$(basename ${DC})" = x"dmd"; then \ |
1763 | 167 if ${DC} ${DFLAGS} -c -of$@ $<; then \ |
168 ${COMPILE_OK}; \ | |
169 else \ | |
170 ${COMPILE_FAILED}; \ | |
171 fi \ | |
172 else \ | |
173 if ${DC} ${DFLAGS} -c -o $@ $<; then \ | |
174 ${COMPILE_OK}; \ | |
175 else \ | |
176 ${COMPILE_FAILED}; \ | |
177 fi \ | |
178 fi | |
179 | |
180 .erl.beam: | |
181 ${COMPILE_STATUS} | |
182 if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \ | |
183 ${COMPILE_OK}; \ | |
184 else \ | |
185 ${COMPILE_FAILED}; \ | |
186 fi | |
187 | |
188 .m.o: | |
189 ${COMPILE_STATUS} | |
190 if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
191 ${COMPILE_OK}; \ | |
192 else \ | |
193 ${COMPILE_FAILED}; \ | |
194 fi | |
195 | |
196 install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra | |
197 for i in ${SUBDIRS}; do \ | |
198 ${DIR_ENTER}; \ | |
199 ${MAKE} ${MFLAGS} install || exit 1; \ | |
200 ${DIR_LEAVE}; \ | |
201 done | |
202 | |
203 for i in ${LIB}; do \ | |
204 ${INSTALL_STATUS}; \ | |
205 if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL_LIB}; then \ | |
206 ${INSTALL_OK}; \ | |
207 else \ | |
208 ${INSTALL_FAILED}; \ | |
209 fi \ | |
210 done | |
211 | |
212 for i in ${STATIC_LIB}; do \ | |
213 ${INSTALL_STATUS}; \ | |
1909 | 214 if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i; then \ |
1763 | 215 ${INSTALL_OK}; \ |
216 else \ | |
217 ${INSTALL_FAILED}; \ | |
218 fi \ | |
219 done | |
220 | |
221 for i in ${PLUGIN}; do \ | |
222 ${INSTALL_STATUS}; \ | |
223 if ${MKDIR_P} ${DESTDIR}${libdir}/${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/${plugindir}/$$i; then \ | |
224 ${INSTALL_OK}; \ | |
225 else \ | |
226 ${INSTALL_FAILED}; \ | |
227 fi \ | |
228 done | |
229 | |
230 for i in ${DATA}; do \ | |
231 ${INSTALL_STATUS}; \ | |
232 if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ | |
233 ${INSTALL_OK}; \ | |
234 else \ | |
235 ${INSTALL_FAILED}; \ | |
236 fi \ | |
237 done | |
238 | |
239 for i in ${PROG}; do \ | |
240 ${INSTALL_STATUS}; \ | |
1877 | 241 if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i; then \ |
1763 | 242 ${INSTALL_OK}; \ |
243 else \ | |
244 ${INSTALL_FAILED}; \ | |
245 fi \ | |
246 done | |
247 | |
248 for i in ${INCLUDES}; do \ | |
249 ${INSTALL_STATUS}; \ | |
250 if ${MKDIR_P} ${DESTDIR}${includedir}/${includesubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ | |
251 ${INSTALL_OK}; \ | |
252 else \ | |
253 ${INSTALL_FAILED}; \ | |
254 fi \ | |
255 done | |
256 | |
257 for i in ${MAN}; do \ | |
258 ${INSTALL_STATUS}; \ | |
259 if ${MKDIR_P} ${DESTDIR}${mandir}/${mansubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ | |
260 ${INSTALL_OK}; \ | |
261 else \ | |
262 ${INSTALL_FAILED}; \ | |
263 fi \ | |
264 done | |
265 | |
266 install-extra: | |
267 | |
268 uninstall: uninstall-extra | |
269 for i in ${SUBDIRS}; do \ | |
270 ${DIR_ENTER}; \ | |
271 ${MAKE} ${MFLAGS} uninstall || exit 1; \ | |
272 ${DIR_LEAVE}; \ | |
273 done | |
274 | |
275 for i in ${LIB}; do \ | |
1865 | 276 if test -f ${DESTDIR}${libdir}/$$i; then \ |
1763 | 277 if ${UNINSTALL_LIB}; then \ |
278 ${DELETE_OK}; \ | |
279 else \ | |
280 ${DELETE_FAILED}; \ | |
281 fi \ | |
282 fi; \ | |
283 done | |
284 | |
285 for i in ${STATIC_LIB}; do \ | |
1865 | 286 if test -f ${DESTDIR}${libdir}/$$i; then \ |
1763 | 287 if rm -f ${DESTDIR}${libdir}/$$i; then \ |
288 ${DELETE_OK}; \ | |
289 else \ | |
290 ${DELETE_FAILED}; \ | |
291 fi \ | |
292 fi \ | |
293 done | |
294 | |
295 for i in ${PLUGIN}; do \ | |
1865 | 296 if test -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \ |
1763 | 297 if rm -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \ |
298 ${DELETE_OK}; \ | |
299 else \ | |
300 ${DELETE_FAILED}; \ | |
301 fi \ | |
302 fi \ | |
303 done | |
304 -rmdir ${DESTDIR}${libdir}/${plugindir} >/dev/null 2>&1 | |
305 | |
306 for i in ${DATA}; do \ | |
1865 | 307 if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ |
1763 | 308 if rm -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ |
309 ${DELETE_OK}; \ | |
310 else \ | |
311 ${DELETE_FAILED}; \ | |
312 fi \ | |
313 fi \ | |
314 done | |
315 | |
316 for i in ${PROG}; do \ | |
1865 | 317 if test -f ${DESTDIR}${bindir}/$$i; then \ |
1763 | 318 if rm -f ${DESTDIR}${bindir}/$$i; then \ |
319 ${DELETE_OK}; \ | |
320 else \ | |
321 ${DELETE_FAILED}; \ | |
322 fi \ | |
323 fi \ | |
324 done | |
325 | |
326 for i in ${INCLUDES}; do \ | |
1865 | 327 if test -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ |
1763 | 328 if rm -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ |
329 ${DELETE_OK}; \ | |
330 else \ | |
331 ${DELETE_FAILED}; \ | |
332 fi \ | |
333 fi \ | |
334 done | |
335 -rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 | |
336 | |
337 for i in ${MAN}; do \ | |
1865 | 338 if test -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ |
1763 | 339 if rm -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ |
340 ${DELETE_OK}; \ | |
341 else \ | |
342 ${DELETE_FAILED}; \ | |
343 fi \ | |
344 fi \ | |
345 done | |
346 | |
347 uninstall-extra: | |
348 | |
349 clean: | |
350 for i in ${SUBDIRS}; do \ | |
351 ${DIR_ENTER}; \ | |
352 ${MAKE} ${MFLAGS} clean || exit 1; \ | |
353 ${DIR_LEAVE}; \ | |
354 done | |
355 | |
1877 | 356 for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps; do \ |
1865 | 357 if test -f $$i -o -d $$i; then \ |
1763 | 358 if rm -fr $$i; then \ |
359 ${DELETE_OK}; \ | |
360 else \ | |
361 ${DELETE_FAILED}; \ | |
362 fi \ | |
363 fi \ | |
364 done | |
365 | |
366 distclean: clean | |
367 for i in ${SUBDIRS}; do \ | |
368 ${DIR_ENTER}; \ | |
369 ${MAKE} ${MFLAGS} distclean || exit 1; \ | |
370 ${DIR_LEAVE}; \ | |
371 done | |
372 | |
1973
f86cb7fc1d4f
Add -pipe -Wall if gcc and fix a few warnings.
Jonathan Schleifer <js@h3c.de>
parents:
1918
diff
changeset
|
373 for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \ |
1865 | 374 if test -f $$i -o -d $$i; then \ |
1763 | 375 if rm -fr $$i; then \ |
376 ${DELETE_OK}; \ | |
377 else \ | |
378 ${DELETE_FAILED}; \ | |
379 fi \ | |
380 fi \ | |
381 done | |
382 | |
383 DIR_ENTER = printf "\033[0;36mEntering directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd $$i || exit 1 | |
384 DIR_LEAVE = printf "\033[0;36mLeaving directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd .. || exit 1 | |
1815 | 385 DEPEND_STATUS = printf "\033[0;33mGenerating dependencies...\033[0m\r" |
386 DEPEND_OK = printf "\033[0;32mSuccessfully generated dependencies.\033[0m\n" | |
387 DEPEND_FAILED = printf "\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1 | |
388 COMPILE_STATUS = printf "\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r" | |
389 COMPILE_OK = printf "\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n" | |
390 COMPILE_FAILED = printf "\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1 | |
1763 | 391 LINK_STATUS = printf "\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r" |
392 LINK_OK = printf "\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n" | |
393 LINK_FAILED = printf "\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 | |
394 INSTALL_STATUS = printf "\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r" | |
395 INSTALL_OK = printf "\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n" | |
396 INSTALL_FAILED = printf "\033[0;31mFailed to install \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 | |
397 DELETE_OK = printf "\033[0;34mDeleted \033[1;34m$$i\033[0;34m.\033[0m\n" | |
398 DELETE_FAILED = printf "\033[0;31mFailed to delete \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 | |
399 | |
400 -include .deps |