xref: /freebsd/lib/csu/i386/Makefile (revision 8e6b01171e30297084bb0b4457c4183c2746aacc)
1#	from: @(#)Makefile	5.6 (Berkeley) 5/22/91
2#	$Id: Makefile,v 1.20 1995/10/20 20:05:15 phk Exp $
3
4CFLAGS+=	-DLIBC_SCCS -fno-omit-frame-pointer
5OBJS=		crt0.o c++rt0.o gcrt0.o scrt0.o sgcrt0.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 -DDYNAMIC ${.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 -DDYNAMIC ${.CURDIR}/crt0.c -o ${.TARGET}
30	${LD} -x -r ${.TARGET}
31	mv a.out ${.TARGET}
32
33# dependencies fudged as for gcrt0.o
34scrt0.o: crt0.o
35	${CC} ${CFLAGS} -c -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
36	${LD} -x -r ${.TARGET}
37	mv a.out ${.TARGET}
38
39# dependencies fudged as for gcrt0.o
40sgcrt0.o: scrt0.o
41	${CC} ${CFLAGS} -c -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
42	${LD} -x -r ${.TARGET}
43	mv a.out ${.TARGET}
44
45beforeinstall:
46	cmp -s ${.CURDIR}/dlfcn.h ${DESTDIR}/usr/include/dlfcn.h || \
47	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
48		${.CURDIR}/dlfcn.h ${DESTDIR}/usr/include
49
50realinstall:
51.for i in ${OBJS}
52	cmp -s $i ${DESTDIR}/usr/lib/$i || \
53	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
54		$i ${DESTDIR}/usr/lib
55.endfor
56
57depend:	.depend
58
59.depend:	crt0.c c++rt0.c
60	rm -f .depend
61	mkdep ${CFLAGS} -DCRT0 -DDYNAMIC ${.CURDIR}/crt0.c
62	mkdep -a ${CFLAGS} ${.CURDIR}/c++rt0.c
63
64lint tags:
65
66.include <bsd.prog.mk>
67