buildsys  Check-in [aa7526de49]

Overview
Comment:Make it possible to add .a files to OBJS when building static libs.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: aa7526de49a3c86a1b3ee01a07079a6e772c39078c987755de03eae5605f8261
User & Date: js on 2011-03-24 15:29:14
Other Links: manifest | tags
Context
2011-03-24
15:56
Add STATIC_PIC_LIB. check-in: c2346ca5a2 user: js tags: trunk
15:29
Make it possible to add .a files to OBJS when building static libs. check-in: aa7526de49 user: js tags: trunk
2011-01-17
16:08
Prevent a possible syntax error when not using shared libs. check-in: 80272a6a79 user: js tags: trunk
Changes

Modified buildsys.mk.in from [4eb32fd7f2] to [454592c0b3].

1

2
3
4
5
6
7
8
9
#

#  Copyright (c) 2007 - 2009, Jonathan Schleifer <js@webkeks.org>
#
#  https://webkeks.org/hg/buildsys/
#
#  Permission to use, copy, modify, and/or distribute this software for any
#  purpose with or without fee is hereby granted, provided that the above
#  copyright notice and this permission notice is present in all copies.
#

>
|







1
2
3
4
5
6
7
8
9
10
#
#  Copyright (c) 2007, 2008, 2009, 2010, 2011
#  Jonathan Schleifer <js@webkeks.org>
#
#  https://webkeks.org/hg/buildsys/
#
#  Permission to use, copy, modify, and/or distribute this software for any
#  purpose with or without fee is hereby granted, provided that the above
#  copyright notice and this permission notice is present in all copies.
#
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

.SILENT:
.SUFFIXES:
.SUFFIXES: .beam .c .c.dep .cc .cc.dep .cxx .cxx.dep .d .erl .lib.o .mo .m .m.dep .mm .mm.dep .o .plugin.o .po .py .pyc .xpm .S .S.dep
.PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales

all:
	${MAKE} ${MFLAGS} subdirs || exit 1
	${MAKE} ${MFLAGS} depend || exit 1
	${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} locales || exit 1

subdirs:
	for i in ${SUBDIRS}; do \
		${DIR_ENTER}; \
		${MAKE} ${MFLAGS} || exit 1; \
		${DIR_LEAVE}; \
	done







|
|
|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

.SILENT:
.SUFFIXES:
.SUFFIXES: .beam .c .c.dep .cc .cc.dep .cxx .cxx.dep .d .erl .lib.o .mo .m .m.dep .mm .mm.dep .o .plugin.o .po .py .pyc .xpm .S .S.dep
.PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales

all:
	${MAKE} ${MFLAGS} subdirs
	${MAKE} ${MFLAGS} depend
	${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} locales

subdirs:
	for i in ${SUBDIRS}; do \
		${DIR_ENTER}; \
		${MAKE} ${MFLAGS} || exit 1; \
		${DIR_LEAVE}; \
	done
170
171
172
173
174
175
176
























177
178
179
180
181
182




183
184
185
186
187
188
189
		${LINK_OK}; \
	else \
		${LINK_FAILED}; \
	fi

${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS}
	${LINK_STATUS}
























	if ${AR} cr $@ ${OBJS} && ${RANLIB} $@; then \
		${LINK_OK}; \
	else \
		${LINK_FAILED}; \
		rm -f $@; \
	fi





locales: ${MO_FILES}

.c.o:
	${COMPILE_STATUS}
	if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \
		${COMPILE_OK}; \







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|




|
>
>
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
		${LINK_OK}; \
	else \
		${LINK_FAILED}; \
	fi

${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS}
	${LINK_STATUS}
	rm -f $@
	objs=""; \
	ars=""; \
	for i in ${OBJS}; do \
		case $$i in \
			*.a) \
				ars="$$ars $$i" \
				;; \
			*.o) \
				objs="$$objs $$i" \
				;; \
		esac \
	done; \
	for i in $$ars; do \
		dir=".$$(echo $$i | sed 's/\//_/g').objs"; \
		rm -fr $$dir; \
		mkdir -p $$dir; \
		cd $$dir; \
		ar x ../$$i; \
		for j in *.o; do \
			objs="$$objs $$dir/$$j"; \
		done; \
		cd ..; \
	done; \
	if ${AR} cr $@ $$objs && ${RANLIB} $@; then \
		${LINK_OK}; \
	else \
		${LINK_FAILED}; \
		rm -f $@; \
	fi; \
	for i in $$ars; do \
		dir=".$$(echo $$i | sed 's/\//_/g').objs"; \
		rm -fr $$dir; \
	done

locales: ${MO_FILES}

.c.o:
	${COMPILE_STATUS}
	if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \
		${COMPILE_OK}; \