2000-10-28 21:26:48 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
GCCDIR= ${.CURDIR}/../../../contrib/gcc.295
|
|
|
|
|
2001-10-04 14:13:16 +00:00
|
|
|
.if ${MACHINE_ARCH} == "alpha"
|
2000-10-31 01:06:28 +00:00
|
|
|
.PATH: ${GCCDIR}/config/alpha
|
|
|
|
SRCS= crtbegin.s crtend.s
|
|
|
|
UGLYHACK= -x assembler
|
|
|
|
.else
|
|
|
|
.PATH: ${GCCDIR}
|
2000-10-28 21:26:48 +00:00
|
|
|
SRCS= crtstuff.c tm.h
|
2000-10-31 01:06:28 +00:00
|
|
|
.endif
|
|
|
|
|
2000-10-28 21:26:48 +00:00
|
|
|
OBJS= crtbegin.o crtend.o
|
|
|
|
SOBJS= crtbegin.So crtend.So
|
|
|
|
CFLAGS+= -I${GCCDIR}/config -I. -DIN_GCC \
|
|
|
|
-finhibit-size-directive -fno-inline-functions \
|
|
|
|
-fno-exceptions -fno-omit-frame-pointer
|
|
|
|
INTERNALLIB= true
|
|
|
|
|
|
|
|
CRTS_CFLAGS= -DCRTSTUFFS_O ${PICFLAG}
|
|
|
|
|
|
|
|
all: ${OBJS} ${SOBJS}
|
|
|
|
|
2001-10-04 14:13:16 +00:00
|
|
|
.if ${MACHINE_ARCH} == "alpha"
|
2000-10-31 01:06:28 +00:00
|
|
|
crtbegin.o crtbegin.So: crtbegin.s
|
|
|
|
crtend.o crtend.So: crtend.s
|
|
|
|
.for PART in begin end
|
|
|
|
CLEANFILES+= crt${PART}.s
|
|
|
|
crt${PART}.s: crt${PART}.asm
|
|
|
|
ln -sf ${.ALLSRC} ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
.else
|
2002-04-05 08:53:35 +00:00
|
|
|
crtbegin.o crtbegin.So crtend.o crtend.So: ${SRCS}
|
2000-10-31 01:06:28 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
crtbegin.o:
|
2000-10-28 21:26:48 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
|
2000-10-31 01:06:28 +00:00
|
|
|
-c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
|
2000-10-28 21:26:48 +00:00
|
|
|
|
2000-10-31 01:06:28 +00:00
|
|
|
crtbegin.So:
|
2000-10-28 21:26:48 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
|
2000-10-31 01:06:28 +00:00
|
|
|
-c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
|
2000-10-28 21:26:48 +00:00
|
|
|
|
2000-10-31 01:06:28 +00:00
|
|
|
crtend.o:
|
2000-10-28 21:26:48 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END \
|
2000-10-31 01:06:28 +00:00
|
|
|
-c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
|
2000-10-28 21:26:48 +00:00
|
|
|
|
2000-10-31 01:06:28 +00:00
|
|
|
crtend.So:
|
2000-10-28 21:26:48 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
|
2000-10-31 01:06:28 +00:00
|
|
|
-c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
|
2000-10-28 21:26:48 +00:00
|
|
|
|
2002-04-05 08:53:35 +00:00
|
|
|
CLEANFILES+= tm.h
|
2000-10-28 21:26:48 +00:00
|
|
|
# KEEP THIS IN SYNC with src/gnu/usr.bin/cc/cc_tools/Makefile !!
|
|
|
|
tm.h:
|
|
|
|
echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' > ${.TARGET}
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET}
|
|
|
|
.endif
|
|
|
|
echo '#include <freebsd.h>' >> ${.TARGET}
|
|
|
|
echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
realinstall:
|
|
|
|
.for file in ${OBJS} ${SOBJS}
|
|
|
|
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
|
|
${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|