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