1# $FreeBSD$ 2 3.PATH: ${.CURDIR}/../common 4 5SRCS= crti.S crtn.S 6OBJS= ${SRCS:N*.h:R:S/$/.o/g} 7OBJS+= gcrt1.o crt1.o Scrt1.o 8CFLAGS+= -I${.CURDIR}/../common \ 9 -I${.CURDIR}/../../libc/include 10 11FILES= ${OBJS} 12FILESMODE= ${LIBMODE} 13FILESOWN= ${LIBOWN} 14FILESGRP= ${LIBGRP} 15FILESDIR= ${LIBDIR} 16 17CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o 18CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s 19 20# See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not 21# directly compiled to .o files. 22 23gcrt1_c.s: crt1_c.c 24 ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c 25 sed ${SED_FIX_NOTE} ${.TARGET} 26 27gcrt1_c.o: gcrt1_c.s 28 ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s 29 30gcrt1.o: gcrt1_c.o crt1_s.o 31 ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o 32 33crt1_c.s: crt1_c.c 34 ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c 35 sed ${SED_FIX_NOTE} ${.TARGET} 36 37crt1_c.o: crt1_c.s 38 ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s 39 40crt1.o: crt1_c.o crt1_s.o 41 ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o 42 ${OBJCOPY} --localize-symbol _start1 crt1.o 43 44Scrt1_c.s: crt1_c.c 45 ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c 46 sed ${SED_FIX_NOTE} ${.TARGET} 47 48Scrt1_c.o: Scrt1_c.s 49 ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s 50 51Scrt1.o: Scrt1_c.o crt1_s.o 52 ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o 53 ${OBJCOPY} --localize-symbol _start1 Scrt1.o 54 55.include <bsd.lib.mk> 56