Makefile revision 1.25
1#	$NetBSD: Makefile,v 1.25 2018/06/02 14:30:07 christos Exp $
2
3S=	${.CURDIR}/../../../..
4
5BASE?= pxeboot_ia32
6PROG= ${BASE}.bin
7NEWVERSWHAT=	"PXE Boot"
8STARTFILE=	${PXESTART}
9RELOC=		0x0
10
11.if (${BASE} != "pxeboot_ia32")
12.PATH.c: ${.CURDIR}/../pxeboot
13.PATH.S: ${.CURDIR}/../pxeboot
14.endif
15
16SRCS= main.c dev_net.c devopen.c conf.c exec.c pxe.c pxe_call.S
17# use our own nfs implementation
18.PATH: ${.CURDIR}/../libsa
19SRCS+= nfs.c
20
21.include <bsd.init.mk>
22
23.if ${MACHINE_ARCH} == "x86_64"
24LDFLAGS+=	-Wl,-m,elf_i386
25AFLAGS+=	-m32
26LIBKERN_ARCH=	i386
27KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
28.endif
29
30CPPFLAGS+= -DSLOW	# for libz
31
32.if (${BASE} == "pxeboot_ia32")
33# Take config values from patchable header
34CPPFLAGS+= -DSUPPORT_SERIAL=boot_params.bp_consdev
35CPPFLAGS+= -DCONSPEED=boot_params.bp_conspeed
36CPPFLAGS+= -DCONSADDR=boot_params.bp_consaddr
37CPPFLAGS+= -DCONSOLE_KEYMAP=boot_params.bp_keymap
38CPPFLAGS+= -DDIRECT_SERIAL
39# Various serial line configurations
40#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_PC -DDIRECT_SERIAL
41#	or
42#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0KBD
43#	or
44#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_AUTO 
45#	and maybe 
46#CPPFLAGS+= -DDIRECT_SERIAL -DCOMCONS_KEYPRESS -DCONSPEED=57600
47.endif
48
49.if (${BASE} == "pxeboot_ia32_com0")
50CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0 -DDIRECT_SERIAL
51.endif
52
53CPPFLAGS+= -DSUPPORT_BOOTP -DSUPPORT_DHCP
54CPPFLAGS+= -DSUPPORT_TFTP
55CPPFLAGS+= -DSUPPORT_NFS
56#CPPFLAGS+= -DNFS_NOSYMLINK
57
58CPPFLAGS+= -DPASS_MEMMAP
59CPPFLAGS+= -DEPIA_HACK
60
61# modules and boot.cfg need special DHCP server setup, disable
62# per default for compatibility with existing setups
63CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0x0c
64
65#CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
66CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
67
68SAMISCCPPFLAGS+= -DHEAP_START=0x10000 -DHEAP_LIMIT=0x30000
69SAMISCMAKEFLAGS+= SA_USE_CREAD=yes	# Read compressed kernels
70
71CPPFLAGS+= -DPASS_BIOSGEOM
72# if you don't use -DPASS_BIOSGEOM, then set I386_INCLUDE_DISK=no
73#I386MISCMAKEFLAGS= I386_INCLUDE_DISK=no
74
75.if (${BASE} == "pxeboot_ia32")
76VERSIONFILE= ${.CURDIR}/version
77.else
78VERSIONFILE= ${.CURDIR}/../pxeboot/version
79.endif
80
81.include "../Makefile.booters"
82
83release: check_RELEASEDIR
84	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
85		${RELEASEDIR}/${MACHINE}/installation/misc
86