diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 14:22:13 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 14:22:13 +0000 |
commit | 19973b9ab8e32d8c0d69b6da899eedf9586ea835 (patch) | |
tree | c710eaa7ab3f9c4c093424215523e96dcc12481e /lib | |
parent | 2b3c2aa00f1eb2d332224c8f196de3dd676fc01a (diff) |
Sync Makefile with what other platforms do; makes dependency tracking actually
work.
ok deraadt@, guenther@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/csu/mips64/Makefile | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/lib/csu/mips64/Makefile b/lib/csu/mips64/Makefile index a77ef54e8d1..d348c28d1e3 100644 --- a/lib/csu/mips64/Makefile +++ b/lib/csu/mips64/Makefile @@ -1,29 +1,60 @@ -# $OpenBSD: Makefile,v 1.5 2013/12/03 06:21:41 guenther Exp $ +# $OpenBSD: Makefile,v 1.6 2013/12/23 14:22:12 kettenis Exp $ -#CFLAGS+= -I${.CURDIR} -mips2 -CFLAGS+= -I${.CURDIR} -OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o +OBJS= crt0.o gcrt0.o +OBJS+= crtbegin.o crtend.o +OBJS+= crtbeginS.o crtendS.o +SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c -.PATH: ${.CURDIR}/../common_elf +ELFDIR= ${.CURDIR}/../common_elf +.PATH: ${ELFDIR} +CFLAGS+= -I${ELFDIR} -I${.CURDIR} all: ${OBJS} -crt0.o: crt0.c ${DEPS} - @echo "${COMPILE.c} -DCRT0 -c ${.ALLSRC} -o ${.TARGET}" - @${COMPILE.c} -DCRT0 -c ${.ALLSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} +crt0.o: crt0.c + @echo ${COMPILE.c} -DCRT0 ${ELFDIR}/crt0.c -o ${.TARGET} + @${COMPILE.c} -DCRT0 ${ELFDIR}/crt0.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o -gcrt0.o: crt0.c ${DEPS} - @echo "${COMPILE.c} -DMCRT0 -c ${.ALLSRC} -o ${.TARGET}" - @${COMPILE.c} -DMCRT0 -c ${.ALLSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} +gcrt0.o: crt0.c + @echo ${COMPILE.c} -DMCRT0 ${ELFDIR}/crt0.c -o ${.TARGET} + @${COMPILE.c} -DMCRT0 ${ELFDIR}/crt0.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + +crtbegin.o: crtbegin.c + @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 + @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 + @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 + @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 realinstall: ${INSTALL} ${INSTALL_COPY} -S -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \ ${DESTDIR}/usr/lib -depend lint tags: +afterdepend: .depend + @(TMP=/tmp/_depend$$$$; \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o:/' \ + < .depend > $$TMP; \ + mv $$TMP .depend) .include <bsd.prog.mk> |