summaryrefslogtreecommitdiff
path: root/lib/csu/i386/Makefile
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-05-30 19:03:25 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-05-30 19:03:25 +0000
commit12a0f955b6f514f264850c67cb8b8d5d6116cc1e (patch)
tree47477d767c4b2192d8bf0106cb5afb1559ddc6a9 /lib/csu/i386/Makefile
parente8974de17ca54835c83e6c68c9c8697ea33d0df0 (diff)
Fix dependancy building for ELF startup code. Changed Makefiles
to build startup code the same on all (ELF) archs. hppa ok mickey@
Diffstat (limited to 'lib/csu/i386/Makefile')
-rw-r--r--lib/csu/i386/Makefile42
1 files changed, 27 insertions, 15 deletions
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index 6e776e3f6f2..234e9f70a87 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -1,43 +1,51 @@
-# $OpenBSD: Makefile,v 1.7 2003/04/17 03:44:59 drahn Exp $
+# $OpenBSD: Makefile,v 1.8 2003/05/30 19:03:24 drahn Exp $
# from: @(#)Makefile 5.5 (Berkeley) 5/21/91
-CFLAGS+= -fno-omit-frame-pointer -DLIBC_SCCS -I${.CURDIR}/..
+CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
-PICFLAG?=-fpic
+ELFDIR= ${.CURDIR}/../common_elf
+.PATH: ${ELFDIR}
+CFLAGS+= -I${ELFDIR}
-.PATH: ${.CURDIR}/../common_elf
-CFLAGS+= -I${.CURDIR}/../common_elf
+PICFLAG?=-fpic
all: ${OBJS}
crt0.o: crt0.c
- ${COMPILE.c} -DCRT0 ${.ALLSRC} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @echo ${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
gcrt0.o: crt0.c
- ${COMPILE.c} -DMCRT0 ${.ALLSRC} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtbegin.o: crtbegin.c
- ${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @echo ${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtbeginS.o: crtbeginS.c
- ${COMPILE.c} ${PICFLAG} ${.ALLSRC} -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtend.o: crtend.c
- ${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
crtendS.o: crtendS.c
- ${COMPILE.c} ${PICFLAG} ${.ALLSRC} -o ${.TARGET}.o
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
@@ -45,6 +53,10 @@ realinstall:
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
${DESTDIR}/usr/lib
-depend:
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
.include <bsd.prog.mk>