custom message type for VM_INFO
[minix3.git] / sys / arch / i386 / stand / Makefile.booters
blob7ea7f1c269a626aa6cee73b0327074f09a53deba
1 #       $NetBSD: Makefile.booters,v 1.88 2013/08/21 15:24:27 matt Exp $
3 .include <bsd.own.mk>
5 STRIPFLAG=
6 BINMODE=444
8 LIBCRT0=        # nothing
9 LIBCRTBEGIN=    # nothing
10 LIBCRTEND=      # nothing
11 LIBC=           # nothing
13 # Make sure we override any optimization options specified by the
14 # user.
15 .if ${MACHINE_ARCH} == "x86_64"
16 CPUFLAGS= -m32
17 .else
18 CPUFLAGS=  -march=i386 -mtune=i386
19 .endif
20 COPTS=  ${OPT_SIZE.${ACTIVE_CC}}
22 I386_STAND_DIR?= $S/arch/i386/stand
24 .PATH: ${I386_STAND_DIR}/lib
26 ROMSTART= start_rom.o
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
35 PXESTART= start_pxe.o
37 CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
38 CPPFLAGS+= -D_STANDALONE
39 LDFLAGS+=  -nostdlib
41 # XXX
42 .if ${MACHINE_ARCH} == "x86_64"
43 CPPFLAGS+=-m32
44 LDFLAGS+=-Wl,-m,elf_i386
45 LIBKERN_ARCH=i386
46 KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
47 .endif
49 CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
50 SRCS+=  vers.c
52 ### find out what to use for libkern
53 KERN_AS=        library
54 .include "${S}/lib/libkern/Makefile.inc"
55 LIBKERN=        ${KERNLIB}
57 ### find out what to use for libz
58 Z_AS=           library
59 .include "${S}/lib/libz/Makefile.inc"
60 LIBZ=           ${ZLIB}
62 ### find out what to use for libsa
63 SA_AS=          library
64 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
65 .include "${S}/lib/libsa/Makefile.inc"
66 LIBSA=          ${SALIB}
68 ### find out what to use for libi386
69 I386DIR= ${I386_STAND_DIR}/lib
70 .include "${I386DIR}/Makefile.inc"
71 LIBI386=                ${I386LIB}
73 cleandir distclean: .WAIT cleanlibdir
75 cleanlibdir:
76         -rm -rf lib
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}
87         ${_MKTARGET_LINK}
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}
93         ${_MKTARGET_LINK}
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 )
99         rm -f ${BASE}.rom.tmp
101 CLEANFILES+= ${BASE}.com
102 ${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
103         ${_MKTARGET_LINK}
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}
110         ${_MKTARGET_LINK}
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>
116 KLINK_MACHINE=  i386
117 .include <bsd.klinks.mk>