summaryrefslogtreecommitdiff
path: root/lib/csu/sparc64
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/sparc64
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/sparc64')
-rw-r--r--lib/csu/sparc64/Makefile37
1 files changed, 24 insertions, 13 deletions
diff --git a/lib/csu/sparc64/Makefile b/lib/csu/sparc64/Makefile
index a7c3c7a7524..27b8c5d3076 100644
--- a/lib/csu/sparc64/Makefile
+++ b/lib/csu/sparc64/Makefile
@@ -1,46 +1,51 @@
-# $OpenBSD: Makefile,v 1.1 2001/08/29 02:26:09 art Exp $
+# $OpenBSD: Makefile,v 1.2 2003/05/30 19:03:24 drahn Exp $
# $NetBSD: Makefile,v 1.6 1996/10/18 05:27:38 thorpej Exp $
-CFLAGS+= -DLIBC_SCCS -DPIC -DELFSIZE=64
-
+CFLAGS+= -DLIBC_SCCS -DELFSIZE=64
OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
-CLEANFILES+= core a.out
-
-.PATH: ${.CURDIR}/../common_elf
-CFLAGS+= -I${.CURDIR}/../common_elf
+ELFDIR= ${.CURDIR}/../common_elf
+.PATH: ${ELFDIR}
+CFLAGS+= -I${ELFDIR}
PICFLAG?=-fpic
all: ${OBJS}
crt0.o: crt0.c
- ${COMPILE.c} -DCRT0 ${.ALLSRC} -o ${.TARGET}.o
+ @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
+ @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
+ @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
@@ -48,4 +53,10 @@ realinstall:
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
${DESTDIR}/usr/lib
+afterdepend:: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+
.include <bsd.prog.mk>