1PACKAGE= clibs-dev 2 3NO_WMISSING_VARIABLE_DECLARATIONS= 4# Can't instrument these files since that breaks non-sanitized programs. 5MK_ASAN:= no 6MK_UBSAN:= no 7 8.include <src.opts.mk> 9MK_SSP= no 10 11.if !defined(BUILDING_TESTS) 12 13OBJS+= Scrt1.o crt1.o gcrt1.o 14OBJS+= crtbegin.o crtbeginS.o crtbeginT.o 15OBJS+= crtend.o crtendS.o 16OBJS+= crti.o crtn.o 17 18CRT1OBJS+= crtbrand.o feature_note.o ignore_init_note.o 19 20ACFLAGS+= -DLOCORE 21 22CFLAGS+= -DSTRIP_FBSDID 23CFLAGS+= -fno-omit-frame-pointer 24CFLAGS+= -I${.CURDIR:H}/common \ 25 -I${SRCTOP}/lib/libc/include \ 26 -I${SRCTOP}/lib/libsys \ 27 28CFLAGS_CRTS= -DSHARED ${PICFLAG} 29 30FILES= ${OBJS} 31FILESMODE= ${LIBMODE} 32FILESOWN= ${LIBOWN} 33FILESGRP= ${LIBGRP} 34FILESDIR= ${LIBDIR} 35# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. 36.undef LIBRARIES_ONLY 37 38CRT1SRC?= crt1_c.c 39CRT1OBJ?= 40 41CLEANFILES+= ${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o 42CLEANFILES+= crti_s.o ${CRT1SRC:C/.[S|c]$/.o/} 43 44crt1.o: ${CRT1SRC:C/.[S|c]$/.o/} ${CRT1OBJS} ${CRT1OBJ} 45 ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} 46 47gcrt1_c.o: ${CRT1SRC} 48 ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/${CRT1SRC} 49 50gcrt1.o: gcrt1_c.o ${CRT1OBJS} ${CRT1OBJ} 51 ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} 52 53Scrt1_c.o: ${CRT1SRC} 54 ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/${CRT1SRC} 55 56Scrt1.o: Scrt1_c.o ${CRT1OBJS} ${CRT1OBJ} 57 ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} 58 59# __FreeBSD_version is recorded in crt1.o et al via crtbrand. 60crtbrand.o: ${SRCTOP}/sys/sys/param.h 61 62crtbegin.o: crtbegin.c 63crtbeginS.o: crtbegin.c 64crtbeginT.o: crtbegin.c 65crtend.o: crtend.c 66crtendS.o: crtend.c 67 68crtbegin.o crtend.o crtbeginT.o: 69 ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]} 70 71crtbeginS.o crtendS.o: 72 ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \ 73 ${.ALLSRC:N*.h:[1]} 74 75crti_s.o: crti.S 76 ${CC} ${CFLAGS} ${ACFLAGS} -c ${.ALLSRC:M*.S} -o ${.TARGET} 77 78crti.o: crti_s.o crtbrand.o 79 ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} 80 81.endif 82 83.include "../Makefile.inc" 84