xref: /freebsd/lib/csu/i386/Makefile (revision 953a3198a35204535cc9d450f04da982a4fea59b)
1#	from: @(#)Makefile	5.6 (Berkeley) 5/22/91
2#	$Id: Makefile,v 1.17 1995/08/06 12:23:18 bde Exp $
3
4CFLAGS+=	-DLIBC_SCCS -DDYNAMIC
5OBJS=		crt0.o gcrt0.o c++rt0.o
6CLEANFILES+=	a.out
7MAN3+=		dlopen.3
8MLINKS+=	dlopen.3 dlsym.3 \
9		dlopen.3 dlerror.3 \
10		dlopen.3 dlclose.3
11
12all: ${OBJS}
13
14crt0.o: crt0.c
15	${CC} ${CFLAGS} -c -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
16	${LD} -x -r ${.TARGET}
17	mv a.out ${.TARGET}
18
19c++rt0.o: c++rt0.c
20	${CC} ${CFLAGS} -fpic -c ${.CURDIR}/c++rt0.c
21	@${LD} -x -r ${.TARGET}
22	@mv a.out ${.TARGET}
23
24#
25# gcrt0.o doesn't really depend on crt0.o, but this is the easiest way
26# to get the dependencies mostly correct.
27#
28gcrt0.o: crt0.o
29	${CC} ${CFLAGS} -c -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
30	${LD} -x -r ${.TARGET}
31	mv a.out ${.TARGET}
32
33beforeinstall:
34	cmp -s ${.CURDIR}/dlfcn.h ${DESTDIR}/usr/include/dlfcn.h || \
35	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
36		${.CURDIR}/dlfcn.h ${DESTDIR}/usr/include
37
38realinstall:
39.for i in ${OBJS}
40	cmp -s $i ${DESTDIR}/usr/lib/$i || \
41	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
42		$i ${DESTDIR}/usr/lib
43.endfor
44
45depend:	.depend
46
47.depend:	crt0.c c++rt0.c
48	rm -f .depend
49	mkdep ${CFLAGS} -DCRT0 ${.CURDIR}/crt0.c
50	mkdep -a ${CFLAGS} ${.CURDIR}/c++rt0.c
51
52lint tags:
53
54.include <bsd.prog.mk>
55