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