Makefile.booters revision 1.98
1# $NetBSD: Makefile.booters,v 1.98 2024/06/29 07:52:16 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" 62SAMISCCPPFLAGS+=-DLIBSA_NFS_IMPLICIT_MOUNT 63.include "${S}/lib/libsa/Makefile.inc" 64LIBSA= ${SALIB} 65 66### find out what to use for libi386 67I386DIR= ${I386_STAND_DIR}/lib 68.include "${I386DIR}/Makefile.inc" 69LIBI386= ${I386LIB} 70 71cleandir distclean: .WAIT cleanlibdir 72 73cleanlibdir: 74 -rm -rf lib 75 76LDFLAGS+=-Wl,-z,noseparate-code -Wl,-M -Wl,-e,start # -N does not work properly. 77 78LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 79 80VERSIONMACHINE=x86 81.include "${S}/conf/newvers_stand.mk" 82 83CLEANFILES+= ${BASE}.sym 84${BASE}.sym: ${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 89CLEANFILES+= ${BASE}.rom ${BASE}.rom.tmp 90${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 91 ${_MKTARGET_LINK} 92 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 93 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 94 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.rom.tmp 95 ${GENPROM} ${ROM_SIZE} < ${BASE}.rom.tmp > ${BASE}.rom || \ 96 ( rm -f ${BASE}.rom && false ) 97 rm -f ${BASE}.rom.tmp 98 99CLEANFILES+= ${BASE}.com 100${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 101 ${_MKTARGET_LINK} 102 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 103 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 104 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com 105 106CLEANFILES+= ${BASE}.bin 107${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 108 ${_MKTARGET_LINK} 109 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 110 ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list 111 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 112 113CWARNFLAGS.gcc+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} 114 115.include <bsd.prog.mk> 116KLINK_MACHINE= i386 117.include <bsd.klinks.mk> 118