Makefile.booters revision 1.88 1 1.88 matt # $NetBSD: Makefile.booters,v 1.88 2013/08/21 15:24:27 matt 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.38 thorpej LIBCRTBEGIN= # nothing
10 1.38 thorpej LIBCRTEND= # nothing
11 1.38 thorpej LIBC= # nothing
12 1.29 tls
13 1.33 thorpej # Make sure we override any optimization options specified by the
14 1.33 thorpej # user.
15 1.37 fvdl .if ${MACHINE_ARCH} == "x86_64"
16 1.58 thorpej CPUFLAGS= -m32
17 1.37 fvdl .else
18 1.81 jakllsch CPUFLAGS= -march=i386 -mtune=i386
19 1.63 mrg .endif
20 1.84 joerg COPTS= ${OPT_SIZE.${ACTIVE_CC}}
21 1.1 perry
22 1.8 drochner I386_STAND_DIR?= $S/arch/i386/stand
23 1.8 drochner
24 1.52 dsl .PATH: ${I386_STAND_DIR}/lib
25 1.32 thorpej
26 1.16 christos ROMSTART= start_rom.o
27 1.8 drochner GENPROMDIR= ${I386_STAND_DIR}/genprom
28 1.32 thorpej GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR}
29 1.32 thorpej GENPROM= ${GENPROMOBJDIR}/genprom
30 1.32 thorpej
31 1.8 drochner .PATH: ${I386_STAND_DIR}/lib/crt/dos
32 1.16 christos DOSSTART= start_dos.o doscommain.o
33 1.32 thorpej
34 1.31 thorpej .PATH: ${I386_STAND_DIR}/lib/crt/pxe
35 1.31 thorpej PXESTART= start_pxe.o
36 1.1 perry
37 1.70 yamt CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
38 1.5 drochner CPPFLAGS+= -D_STANDALONE
39 1.68 lukem LDFLAGS+= -nostdlib
40 1.37 fvdl
41 1.37 fvdl # XXX
42 1.37 fvdl .if ${MACHINE_ARCH} == "x86_64"
43 1.37 fvdl CPPFLAGS+=-m32
44 1.68 lukem LDFLAGS+=-Wl,-m,elf_i386
45 1.37 fvdl LIBKERN_ARCH=i386
46 1.37 fvdl KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
47 1.37 fvdl .endif
48 1.1 perry
49 1.41 dsl CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
50 1.26 jdolecek SRCS+= vers.c
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.78 tsutsui vers.c: ${VERSIONFILE} ${SOURCES} ${S}/conf/newvers_stand.sh
83 1.82 joerg ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT}
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