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