Makefile.booters revision 1.101
1# $NetBSD: Makefile.booters,v 1.101 2024/06/29 13:52:39 rin Exp $ 2 3NOLIBCSANITIZER= 4NOSANITIZER= 5.include <bsd.own.mk> 6 7STRIPFLAG= 8BINMODE=444 9 10LIBCRT0= # nothing 11LIBCRTI= # nothing 12LIBCRTBEGIN= # nothing 13LIBCRTEND= # nothing 14LIBC= # nothing 15 16# Make sure we override any optimization options specified by the 17# user. 18.if ${MACHINE_ARCH} == "x86_64" 19CPUFLAGS= -m32 -march=i386 -mtune=i386 20.else 21CPUFLAGS= -march=i386 -mtune=i386 22.endif 23COPTS= ${OPT_SIZE.${ACTIVE_CC}} 24 25I386_STAND_DIR?= $S/arch/i386/stand 26 27.PATH: ${I386_STAND_DIR}/lib 28 29CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa 30CPPFLAGS+= -D_STANDALONE 31LDFLAGS+= -nostdlib 32 33# XXX 34.if ${MACHINE_ARCH} == "x86_64" 35CPPFLAGS+=-m32 36LDFLAGS+=-Wl,-m,elf_i386 37LIBKERN_ARCH=i386 38KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386" 39.endif 40 41CLEANFILES+= ${STARTFILE} ${BASE}.list 42 43### find out what to use for libkern 44KERN_AS= library 45.include "${S}/lib/libkern/Makefile.inc" 46LIBKERN= ${KERNLIB} 47 48### find out what to use for libz 49Z_AS= library 50.include "${S}/lib/libz/Makefile.inc" 51LIBZ= ${ZLIB} 52 53### find out what to use for libsa 54SA_AS= library 55SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 56SAMISCCPPFLAGS+=-DLIBSA_NFS_IMPLICIT_MOUNT 57.include "${S}/lib/libsa/Makefile.inc" 58LIBSA= ${SALIB} 59 60### find out what to use for libi386 61I386DIR= ${I386_STAND_DIR}/lib 62.include "${I386DIR}/Makefile.inc" 63LIBI386= ${I386LIB} 64 65cleandir distclean: .WAIT cleanlibdir 66 67cleanlibdir: 68 -rm -rf lib 69 70LDFLAGS+=-Wl,-z,noseparate-code -Wl,-M -Wl,-e,start # -N does not work properly. 71 72LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 73 74VERSIONMACHINE=x86 75.include "${S}/conf/newvers_stand.mk" 76 77CLEANFILES+= ${BASE}.sym 78${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 79 ${_MKTARGET_LINK} 80 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 81 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 82 83CLEANFILES+= ${BASE}.com 84${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 85 ${_MKTARGET_LINK} 86 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 87 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 88 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com 89 90CLEANFILES+= ${BASE}.bin 91${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 92 ${_MKTARGET_LINK} 93 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 94 ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list 95 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 96 97CWARNFLAGS.gcc+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} 98 99.include <bsd.prog.mk> 100KLINK_MACHINE= i386 101.include <bsd.klinks.mk> 102