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