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