Mercurial > audlegacy-plugins
annotate buildsys.mk.in @ 1890:a551306c5f18
Link against stdc++ library for STL use.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Wed, 26 Sep 2007 11:30:04 -0500 |
parents | 8bdede3414cd |
children | a21e391a5490 |
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@ | |
1879
81cdc01db60e
Update buildsys (adds ${PROG_SUFFIX}).
Jonathan Schleifer <js@h3c.de>
parents:
1877
diff
changeset
|
38 PROG_SUFFIX = @EXEEXT@ |
1763 | 39 LIB_CPPFLAGS = @LIB_CPPFLAGS@ |
40 LIB_CFLAGS = @LIB_CFLAGS@ | |
41 LIB_LDFLAGS = @LIB_LDFLAGS@ | |
42 LIB_PREFIX = @LIB_PREFIX@ | |
43 LIB_SUFFIX = @LIB_SUFFIX@ | |
44 PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ | |
45 PLUGIN_CFLAGS = @PLUGIN_CFLAGS@ | |
46 PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ | |
47 PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ | |
48 INSTALL_LIB = @INSTALL_LIB@ | |
49 UNINSTALL_LIB = @UNINSTALL_LIB@ | |
50 CLEAN_LIB = @CLEAN_LIB@ | |
51 LN_S = @LN_S@ | |
52 MKDIR_P = mkdir -p | |
1863 | 53 INSTALL = install |
1763 | 54 SHELL = @SHELL@ |
55 prefix = @prefix@ | |
56 exec_prefix = @exec_prefix@ | |
57 bindir = @bindir@ | |
58 libdir = @libdir@ | |
59 plugindir ?= ${PACKAGE} | |
60 datarootdir = @datarootdir@ | |
61 datadir = @datadir@ | |
62 includedir = @includedir@ | |
63 includesubdir ?= ${PACKAGE} | |
64 mandir = @mandir@ | |
65 mansubdir ?= man1 | |
66 | |
67 OBJS1 = ${SRCS:.c=.o} | |
68 OBJS2 = ${OBJS1:.cc=.o} | |
69 OBJS3 = ${OBJS2:.cxx=.o} | |
70 OBJS4 = ${OBJS3:.d=.o} | |
71 OBJS5 = ${OBJS4:.erl=.beam} | |
72 OBJS += ${OBJS5:.m=.o} | |
73 | |
74 .SILENT: | |
75 .SUFFIXES: .beam .c .cc .cxx .d .erl .m | |
76 .PHONY: all subdirs depend install uninstall clean distclean | |
77 | |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
78 all: |
1868 | 79 for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \ |
1845 | 80 ${MAKE} ${MFLAGS} $$i || exit 1; \ |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
81 done |
1763 | 82 |
83 subdirs: | |
84 for i in ${SUBDIRS}; do \ | |
85 ${DIR_ENTER}; \ | |
86 ${MAKE} ${MFLAGS} || exit 1; \ | |
87 ${DIR_LEAVE}; \ | |
88 done | |
89 | |
90 depend: pre-depend ${SRCS} | |
91 regen=0; \ | |
1865 | 92 for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ |
93 if test x"$$regen" = x"1"; then \ | |
1881
8bdede3414cd
Optimize dependency generation.
Jonathan Schleifer <js@h3c.de>
parents:
1879
diff
changeset
|
94 list=""; \ |
1815 | 95 ${DEPEND_STATUS}; \ |
1763 | 96 rm -f .deps; \ |
97 for i in ${SRCS}; do \ | |
98 case $${i##*.} in \ | |
99 c|cc|cxx|m) \ | |
1881
8bdede3414cd
Optimize dependency generation.
Jonathan Schleifer <js@h3c.de>
parents:
1879
diff
changeset
|
100 list="$$list $$i"; \ |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
101 ;; \ |
1763 | 102 esac; \ |
103 done; \ | |
1881
8bdede3414cd
Optimize dependency generation.
Jonathan Schleifer <js@h3c.de>
parents:
1879
diff
changeset
|
104 if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \ |
1826
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
105 ${DEPEND_OK}; \ |
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
106 else \ |
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
107 ${DEPEND_FAILED}; \ |
d7709de0882c
Fix dependencies and other parallel stuff.
Jonathan Schleifer <js@h3c.de>
parents:
1815
diff
changeset
|
108 fi; \ |
1763 | 109 fi |
110 | |
111 pre-depend: | |
112 | |
1815 | 113 ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} |
1763 | 114 ${LINK_STATUS} |
115 if ${LD} -o $@ ${OBJS} ${LDFLAGS} ${LIBS}; then \ | |
116 ${LINK_OK}; \ | |
117 else \ | |
118 ${LINK_FAILED}; \ | |
119 fi | |
120 | |
121 ${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${OBJS} | |
122 ${LINK_STATUS} | |
123 if ${LD} -o $@ ${OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ | |
124 ${LINK_OK}; \ | |
125 else \ | |
126 ${LINK_FAILED}; \ | |
127 fi | |
128 | |
129 ${PLUGIN} ${PLUGIN_NONST}: ${EXT_DEPS} ${OBJS} | |
130 ${LINK_STATUS} | |
131 if ${LD} -o $@ ${OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ | |
132 ${LINK_OK}; \ | |
133 else \ | |
134 ${LINK_FAILED}; \ | |
135 fi | |
136 | |
137 ${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} | |
138 ${LINK_STATUS} | |
139 if ${AR} cr $@ ${OBJS}; then \ | |
140 ${LINK_OK}; \ | |
141 else \ | |
142 ${LINK_FAILED}; \ | |
143 fi | |
144 | |
145 .c.o: | |
146 ${COMPILE_STATUS} | |
147 if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
148 ${COMPILE_OK}; \ | |
149 else \ | |
150 ${COMPILE_FAILED}; \ | |
151 fi | |
152 | |
153 .cc.o .cxx.o: | |
154 ${COMPILE_STATUS} | |
155 if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
156 ${COMPILE_OK}; \ | |
157 else \ | |
158 ${COMPILE_FAILED}; \ | |
159 fi | |
160 | |
161 .d.o: | |
162 ${COMPILE_STATUS} | |
1865 | 163 if test x"$(basename ${DC})" = x"dmd"; then \ |
1763 | 164 if ${DC} ${DFLAGS} -c -of$@ $<; then \ |
165 ${COMPILE_OK}; \ | |
166 else \ | |
167 ${COMPILE_FAILED}; \ | |
168 fi \ | |
169 else \ | |
170 if ${DC} ${DFLAGS} -c -o $@ $<; then \ | |
171 ${COMPILE_OK}; \ | |
172 else \ | |
173 ${COMPILE_FAILED}; \ | |
174 fi \ | |
175 fi | |
176 | |
177 .erl.beam: | |
178 ${COMPILE_STATUS} | |
179 if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \ | |
180 ${COMPILE_OK}; \ | |
181 else \ | |
182 ${COMPILE_FAILED}; \ | |
183 fi | |
184 | |
185 .m.o: | |
186 ${COMPILE_STATUS} | |
187 if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ | |
188 ${COMPILE_OK}; \ | |
189 else \ | |
190 ${COMPILE_FAILED}; \ | |
191 fi | |
192 | |
193 install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra | |
194 for i in ${SUBDIRS}; do \ | |
195 ${DIR_ENTER}; \ | |
196 ${MAKE} ${MFLAGS} install || exit 1; \ | |
197 ${DIR_LEAVE}; \ | |
198 done | |
199 | |
200 for i in ${LIB}; do \ | |
201 ${INSTALL_STATUS}; \ | |
202 if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL_LIB}; then \ | |
203 ${INSTALL_OK}; \ | |
204 else \ | |
205 ${INSTALL_FAILED}; \ | |
206 fi \ | |
207 done | |
208 | |
209 for i in ${STATIC_LIB}; do \ | |
210 ${INSTALL_STATUS}; \ | |
211 if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i; then \ | |
212 ${INSTALL_OK}; \ | |
213 else \ | |
214 ${INSTALL_FAILED}; \ | |
215 fi \ | |
216 done | |
217 | |
218 for i in ${PLUGIN}; do \ | |
219 ${INSTALL_STATUS}; \ | |
220 if ${MKDIR_P} ${DESTDIR}${libdir}/${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/${plugindir}/$$i; then \ | |
221 ${INSTALL_OK}; \ | |
222 else \ | |
223 ${INSTALL_FAILED}; \ | |
224 fi \ | |
225 done | |
226 | |
227 for i in ${DATA}; do \ | |
228 ${INSTALL_STATUS}; \ | |
229 if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ | |
230 ${INSTALL_OK}; \ | |
231 else \ | |
232 ${INSTALL_FAILED}; \ | |
233 fi \ | |
234 done | |
235 | |
236 for i in ${PROG}; do \ | |
237 ${INSTALL_STATUS}; \ | |
1877 | 238 if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i; then \ |
1763 | 239 ${INSTALL_OK}; \ |
240 else \ | |
241 ${INSTALL_FAILED}; \ | |
242 fi \ | |
243 done | |
244 | |
245 for i in ${INCLUDES}; do \ | |
246 ${INSTALL_STATUS}; \ | |
247 if ${MKDIR_P} ${DESTDIR}${includedir}/${includesubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ | |
248 ${INSTALL_OK}; \ | |
249 else \ | |
250 ${INSTALL_FAILED}; \ | |
251 fi \ | |
252 done | |
253 | |
254 for i in ${MAN}; do \ | |
255 ${INSTALL_STATUS}; \ | |
256 if ${MKDIR_P} ${DESTDIR}${mandir}/${mansubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ | |
257 ${INSTALL_OK}; \ | |
258 else \ | |
259 ${INSTALL_FAILED}; \ | |
260 fi \ | |
261 done | |
262 | |
263 install-extra: | |
264 | |
265 uninstall: uninstall-extra | |
266 for i in ${SUBDIRS}; do \ | |
267 ${DIR_ENTER}; \ | |
268 ${MAKE} ${MFLAGS} uninstall || exit 1; \ | |
269 ${DIR_LEAVE}; \ | |
270 done | |
271 | |
272 for i in ${LIB}; do \ | |
1865 | 273 if test -f ${DESTDIR}${libdir}/$$i; then \ |
1763 | 274 if ${UNINSTALL_LIB}; then \ |
275 ${DELETE_OK}; \ | |
276 else \ | |
277 ${DELETE_FAILED}; \ | |
278 fi \ | |
279 fi; \ | |
280 done | |
281 | |
282 for i in ${STATIC_LIB}; do \ | |
1865 | 283 if test -f ${DESTDIR}${libdir}/$$i; then \ |
1763 | 284 if rm -f ${DESTDIR}${libdir}/$$i; then \ |
285 ${DELETE_OK}; \ | |
286 else \ | |
287 ${DELETE_FAILED}; \ | |
288 fi \ | |
289 fi \ | |
290 done | |
291 | |
292 for i in ${PLUGIN}; do \ | |
1865 | 293 if test -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \ |
1763 | 294 if rm -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \ |
295 ${DELETE_OK}; \ | |
296 else \ | |
297 ${DELETE_FAILED}; \ | |
298 fi \ | |
299 fi \ | |
300 done | |
301 -rmdir ${DESTDIR}${libdir}/${plugindir} >/dev/null 2>&1 | |
302 | |
303 for i in ${DATA}; do \ | |
1865 | 304 if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ |
1763 | 305 if rm -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ |
306 ${DELETE_OK}; \ | |
307 else \ | |
308 ${DELETE_FAILED}; \ | |
309 fi \ | |
310 fi \ | |
311 done | |
312 | |
313 for i in ${PROG}; do \ | |
1865 | 314 if test -f ${DESTDIR}${bindir}/$$i; then \ |
1763 | 315 if rm -f ${DESTDIR}${bindir}/$$i; then \ |
316 ${DELETE_OK}; \ | |
317 else \ | |
318 ${DELETE_FAILED}; \ | |
319 fi \ | |
320 fi \ | |
321 done | |
322 | |
323 for i in ${INCLUDES}; do \ | |
1865 | 324 if test -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ |
1763 | 325 if rm -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ |
326 ${DELETE_OK}; \ | |
327 else \ | |
328 ${DELETE_FAILED}; \ | |
329 fi \ | |
330 fi \ | |
331 done | |
332 -rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 | |
333 | |
334 for i in ${MAN}; do \ | |
1865 | 335 if test -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ |
1763 | 336 if rm -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ |
337 ${DELETE_OK}; \ | |
338 else \ | |
339 ${DELETE_FAILED}; \ | |
340 fi \ | |
341 fi \ | |
342 done | |
343 | |
344 uninstall-extra: | |
345 | |
346 clean: | |
347 for i in ${SUBDIRS}; do \ | |
348 ${DIR_ENTER}; \ | |
349 ${MAKE} ${MFLAGS} clean || exit 1; \ | |
350 ${DIR_LEAVE}; \ | |
351 done | |
352 | |
1877 | 353 for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps; do \ |
1865 | 354 if test -f $$i -o -d $$i; then \ |
1763 | 355 if rm -fr $$i; then \ |
356 ${DELETE_OK}; \ | |
357 else \ | |
358 ${DELETE_FAILED}; \ | |
359 fi \ | |
360 fi \ | |
361 done | |
362 | |
363 distclean: clean | |
364 for i in ${SUBDIRS}; do \ | |
365 ${DIR_ENTER}; \ | |
366 ${MAKE} ${MFLAGS} distclean || exit 1; \ | |
367 ${DIR_LEAVE}; \ | |
368 done | |
369 | |
1877 | 370 for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \ |
1865 | 371 if test -f $$i -o -d $$i; then \ |
1763 | 372 if rm -fr $$i; then \ |
373 ${DELETE_OK}; \ | |
374 else \ | |
375 ${DELETE_FAILED}; \ | |
376 fi \ | |
377 fi \ | |
378 done | |
379 | |
380 DIR_ENTER = printf "\033[0;36mEntering directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd $$i || exit 1 | |
381 DIR_LEAVE = printf "\033[0;36mLeaving directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd .. || exit 1 | |
1815 | 382 DEPEND_STATUS = printf "\033[0;33mGenerating dependencies...\033[0m\r" |
383 DEPEND_OK = printf "\033[0;32mSuccessfully generated dependencies.\033[0m\n" | |
384 DEPEND_FAILED = printf "\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1 | |
385 COMPILE_STATUS = printf "\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r" | |
386 COMPILE_OK = printf "\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n" | |
387 COMPILE_FAILED = printf "\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1 | |
1763 | 388 LINK_STATUS = printf "\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r" |
389 LINK_OK = printf "\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n" | |
390 LINK_FAILED = printf "\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 | |
391 INSTALL_STATUS = printf "\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r" | |
392 INSTALL_OK = printf "\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n" | |
393 INSTALL_FAILED = printf "\033[0;31mFailed to install \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 | |
394 DELETE_OK = printf "\033[0;34mDeleted \033[1;34m$$i\033[0;34m.\033[0m\n" | |
395 DELETE_FAILED = printf "\033[0;31mFailed to delete \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 | |
396 | |
397 -include .deps |