1 # $NetBSD: Makefile.booters,v 1.88 2013/08/21 15:24:27 matt Exp $
13 # Make sure we override any optimization options specified by the
15 .if ${MACHINE_ARCH} == "x86_64"
18 CPUFLAGS= -march=i386 -mtune=i386
20 COPTS= ${OPT_SIZE.${ACTIVE_CC}}
22 I386_STAND_DIR?= $S/arch/i386/stand
24 .PATH: ${I386_STAND_DIR}/lib
27 GENPROMDIR= ${I386_STAND_DIR}/genprom
28 GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR}
29 GENPROM= ${GENPROMOBJDIR}/genprom
31 .PATH: ${I386_STAND_DIR}/lib/crt/dos
32 DOSSTART= start_dos.o doscommain.o
34 .PATH: ${I386_STAND_DIR}/lib/crt/pxe
37 CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
38 CPPFLAGS+= -D_STANDALONE
42 .if ${MACHINE_ARCH} == "x86_64"
44 LDFLAGS+=-Wl,-m,elf_i386
46 KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
49 CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
52 ### find out what to use for libkern
54 .include "${S}/lib/libkern/Makefile.inc"
57 ### find out what to use for libz
59 .include "${S}/lib/libz/Makefile.inc"
62 ### find out what to use for libsa
64 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
65 .include "${S}/lib/libsa/Makefile.inc"
68 ### find out what to use for libi386
69 I386DIR= ${I386_STAND_DIR}/lib
70 .include "${I386DIR}/Makefile.inc"
73 cleandir distclean: .WAIT cleanlibdir
78 LDFLAGS+=-Wl,-M -Wl,-e,start # -N does not work properly.
80 LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA}
82 vers.c: ${VERSIONFILE} ${SOURCES} ${S}/conf/newvers_stand.sh
83 ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT}
85 CLEANFILES+= ${BASE}.sym
86 ${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
88 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
89 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
91 CLEANFILES+= ${BASE}.rom ${BASE}.rom.tmp
92 ${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
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 )
101 CLEANFILES+= ${BASE}.com
102 ${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
104 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
105 ${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
106 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com
108 CLEANFILES+= ${BASE}.bin
109 ${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
111 ${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
112 ${STARTFILE} ${OBJS} ${LIBLIST} > ${BASE}.list
113 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
115 .include <bsd.prog.mk>
117 .include <bsd.klinks.mk>