2004-02-14 10:48:37 +03:00
|
|
|
# $NetBSD: Makefile.inc,v 1.8 2004/02/14 07:48:37 simonb Exp $
|
1997-10-27 04:03:39 +03:00
|
|
|
# from: @(#)Makefile 5.5 (Berkeley) 5/21/91
|
|
|
|
|
1999-03-20 01:50:20 +03:00
|
|
|
CPPFLAGS+= -DLIBC_SCCS -I${.CURDIR}/../common_aout
|
1999-02-27 06:28:30 +03:00
|
|
|
OBJS+= crt0.o gcrt0.o scrt0.o
|
1997-10-27 04:03:39 +03:00
|
|
|
SRCS= crt0.c
|
|
|
|
|
2002-11-12 17:33:48 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.shlib.mk>
|
|
|
|
|
2004-02-14 10:48:37 +03:00
|
|
|
.if ${MKPIC} != "no" && ${SHLINKINSTALLDIR} != "/usr/libexec"
|
2002-11-12 17:33:48 +03:00
|
|
|
OBJS+= lcrt0.o
|
|
|
|
.endif
|
|
|
|
|
2000-01-22 22:37:57 +03:00
|
|
|
realall: ${OBJS}
|
1997-10-27 04:03:39 +03:00
|
|
|
|
|
|
|
crt0.o: ${SRCS}
|
|
|
|
@echo "${COMPILE.c} -DCRT0 -DDYNAMIC ${.CURDIR}/${SRCS} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DCRT0 -DDYNAMIC ${.CURDIR}/${SRCS} -o ${.TARGET}.o
|
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2003-11-11 14:35:03 +03:00
|
|
|
# dependant on crt0.o to pick up header dependencies
|
|
|
|
gcrt0.o: ${SRCS} crt0.o
|
1997-10-27 04:03:39 +03:00
|
|
|
@echo "${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o
|
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2003-11-11 14:35:03 +03:00
|
|
|
scrt0.o: ${SRCS} crt0.o
|
1997-10-27 04:03:39 +03:00
|
|
|
@echo "${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o
|
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2002-11-12 17:33:48 +03:00
|
|
|
# same as crt0.o modulo the dynamic linker is in /libexec
|
2003-11-11 14:35:03 +03:00
|
|
|
lcrt0.o: ${SRCS} crt0.o
|
2002-11-12 17:33:48 +03:00
|
|
|
@echo "${COMPILE.c} -DCRT0 -DDYNAMIC -DLDSO=\"${SHLINKINSTALLDIR}/ld.so\" ${.CURDIR}/${SRCS} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DCRT0 -DDYNAMIC -DLDSO=\"${SHLINKINSTALLDIR}/ld.so\" ${.CURDIR}/${SRCS} -o ${.TARGET}.o
|
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
1997-10-27 04:03:39 +03:00
|
|
|
.if make(depend)
|
|
|
|
CPPFLAGS+= -DDYNAMIC
|
|
|
|
.endif
|
|
|
|
|
|
|
|
FILES=${OBJS}
|
2001-06-07 19:22:49 +04:00
|
|
|
FILESDIR=${LIBDIR}
|
1997-10-27 04:03:39 +03:00
|
|
|
|
2004-02-14 10:48:37 +03:00
|
|
|
.if ${MKPIC} != "no" && ${SHLINKINSTALLDIR} != "/usr/libexec"
|
2002-11-12 17:33:48 +03:00
|
|
|
FILESDIR_lcrt0.o:=${SHLIBINSTALLDIR}
|
|
|
|
FILESNAME_lcrt0.o:=crt0.o
|
2004-02-14 10:48:37 +03:00
|
|
|
.endif
|
2002-11-12 17:33:48 +03:00
|
|
|
|
1997-10-27 04:03:39 +03:00
|
|
|
.include <bsd.prog.mk>
|