Makefile.booters revision 1.90
1# $NetBSD: Makefile.booters,v 1.90 2015/03/08 19:47:17 martin 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} vers.c ${BASE}.list 51SRCS+= vers.c 52 53### find out what to use for libkern 54KERN_AS= library 55.include "${S}/lib/libkern/Makefile.inc" 56LIBKERN= ${KERNLIB} 57 58### find out what to use for libz 59Z_AS= library 60.include "${S}/lib/libz/Makefile.inc" 61LIBZ= ${ZLIB} 62 63### find out what to use for libsa 64SA_AS= library 65SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 66.include "${S}/lib/libsa/Makefile.inc" 67LIBSA= ${SALIB} 68 69### find out what to use for libi386 70I386DIR= ${I386_STAND_DIR}/lib 71.include "${I386DIR}/Makefile.inc" 72LIBI386= ${I386LIB} 73 74cleandir distclean: .WAIT cleanlibdir 75 76cleanlibdir: 77 -rm -rf lib 78 79LDFLAGS+=-Wl,-M -Wl,-e,start # -N does not work properly. 80 81LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 82 83vers.c: ${VERSIONFILE} ${SOURCES} ${S}/conf/newvers_stand.sh 84 ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT} 85 86CLEANFILES+= ${BASE}.sym 87${BASE}.sym: ${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 92CLEANFILES+= ${BASE}.rom ${BASE}.rom.tmp 93${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 94 ${_MKTARGET_LINK} 95 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 96 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 97 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.rom.tmp 98 ${GENPROM} ${ROM_SIZE} < ${BASE}.rom.tmp > ${BASE}.rom || \ 99 ( rm -f ${BASE}.rom && false ) 100 rm -f ${BASE}.rom.tmp 101 102CLEANFILES+= ${BASE}.com 103${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 104 ${_MKTARGET_LINK} 105 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 106 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list 107 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com 108 109CLEANFILES+= ${BASE}.bin 110${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 111 ${_MKTARGET_LINK} 112 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \ 113 ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list 114 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 115 116.include <bsd.prog.mk> 117KLINK_MACHINE= i386 118.include <bsd.klinks.mk> 119