Makefile.booters revision 1.100
1# $NetBSD: Makefile.booters,v 1.100 2024/06/29 13:46:40 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 29.PATH: ${I386_STAND_DIR}/lib/crt/pxe 30PXESTART= start_pxe.o 31 32CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa 33CPPFLAGS+= -D_STANDALONE 34LDFLAGS+= -nostdlib 35 36# XXX 37.if ${MACHINE_ARCH} == "x86_64" 38CPPFLAGS+=-m32 39LDFLAGS+=-Wl,-m,elf_i386 40LIBKERN_ARCH=i386 41KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386" 42.endif 43 44CLEANFILES+= ${STARTFILE} ${BASE}.list 45 46### find out what to use for libkern 47KERN_AS= library 48.include "${S}/lib/libkern/Makefile.inc" 49LIBKERN= ${KERNLIB} 50 51### find out what to use for libz 52Z_AS= library 53.include "${S}/lib/libz/Makefile.inc" 54LIBZ= ${ZLIB} 55 56### find out what to use for libsa 57SA_AS= library 58SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 59SAMISCCPPFLAGS+=-DLIBSA_NFS_IMPLICIT_MOUNT 60.include "${S}/lib/libsa/Makefile.inc" 61LIBSA= ${SALIB} 62 63### find out what to use for libi386 64I386DIR= ${I386_STAND_DIR}/lib 65.include "${I386DIR}/Makefile.inc" 66LIBI386= ${I386LIB} 67 68cleandir distclean: .WAIT cleanlibdir 69 70cleanlibdir: 71 -rm -rf lib 72 73LDFLAGS+=-Wl,-z,noseparate-code -Wl,-M -Wl,-e,start # -N does not work properly. 74 75LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 76 77VERSIONMACHINE=x86 78.include "${S}/conf/newvers_stand.mk" 79 80CLEANFILES+= ${BASE}.sym 81${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 82 ${_MKTARGET_LINK} 83 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 84 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 85 86CLEANFILES+= ${BASE}.com 87${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 88 ${_MKTARGET_LINK} 89 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 90 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 91 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com 92 93CLEANFILES+= ${BASE}.bin 94${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 95 ${_MKTARGET_LINK} 96 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 97 ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list 98 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 99 100CWARNFLAGS.gcc+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} 101 102.include <bsd.prog.mk> 103KLINK_MACHINE= i386 104.include <bsd.klinks.mk> 105