summaryrefslogtreecommitdiff
path: root/lib/csu/alpha/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/alpha/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/alpha/Makefile')
-rw-r--r--lib/csu/alpha/Makefile37
1 files changed, 24 insertions, 13 deletions
diff --git a/lib/csu/alpha/Makefile b/lib/csu/alpha/Makefile
index ff495418a97..687ac1892da 100644
--- a/lib/csu/alpha/Makefile
+++ b/lib/csu/alpha/Makefile
@@ -1,46 +1,51 @@
-# $OpenBSD: Makefile,v 1.12 2001/05/29 07:34:30 deraadt Exp $
+# $OpenBSD: Makefile,v 1.13 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>