11.30Srin#	$NetBSD: Makefile,v 1.30 2024/06/29 13:52:39 rin Exp $
21.1Sthorpej
31.17StsutsuiS=	${.CURDIR}/../../../..
41.1Sthorpej
51.3SthorpejBASE?= pxeboot_ia32
61.2SthorpejPROG= ${BASE}.bin
71.1SthorpejNEWVERSWHAT=	"PXE Boot"
81.30SrinSTARTFILE=	start_pxe.o
91.2SthorpejRELOC=		0x0
101.1Sthorpej
111.3Sthorpej.if (${BASE} != "pxeboot_ia32")
121.3Sthorpej.PATH.c: ${.CURDIR}/../pxeboot
131.3Sthorpej.PATH.S: ${.CURDIR}/../pxeboot
141.3Sthorpej.endif
151.1Sthorpej
161.26SmanuSRCS= main.c dev_net.c devopen.c conf.c 
171.26SmanuSRCS+=exec.c exec_multiboot1.c exec_multiboot2.c pxe.c pxe_call.S
181.6Smycroft
191.25Schristos.include <bsd.init.mk>
201.10Smrg
211.16Sabs.if ${MACHINE_ARCH} == "x86_64"
221.11SlukemLDFLAGS+=	-Wl,-m,elf_i386
231.11SlukemAFLAGS+=	-m32
241.11SlukemLIBKERN_ARCH=	i386
251.8SchsKERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
261.8Schs.endif
271.8Schs
281.6SmycroftCPPFLAGS+= -DSLOW	# for libz
291.1Sthorpej
301.3Sthorpej.if (${BASE} == "pxeboot_ia32")
311.9Sdsl# Take config values from patchable header
321.9SdslCPPFLAGS+= -DSUPPORT_SERIAL=boot_params.bp_consdev
331.9SdslCPPFLAGS+= -DCONSPEED=boot_params.bp_conspeed
341.9SdslCPPFLAGS+= -DCONSADDR=boot_params.bp_consaddr
351.9SdslCPPFLAGS+= -DCONSOLE_KEYMAP=boot_params.bp_keymap
361.24SchristosCPPFLAGS+= -DDIRECT_SERIAL
371.1Sthorpej# Various serial line configurations
381.9Sdsl#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_PC -DDIRECT_SERIAL
391.1Sthorpej#	or
401.1Sthorpej#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0KBD
411.1Sthorpej#	or
421.1Sthorpej#CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_AUTO 
431.1Sthorpej#	and maybe 
441.1Sthorpej#CPPFLAGS+= -DDIRECT_SERIAL -DCOMCONS_KEYPRESS -DCONSPEED=57600
451.3Sthorpej.endif
461.3Sthorpej
471.3Sthorpej.if (${BASE} == "pxeboot_ia32_com0")
481.3SthorpejCPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0 -DDIRECT_SERIAL
491.3Sthorpej.endif
501.1Sthorpej
511.1SthorpejCPPFLAGS+= -DSUPPORT_BOOTP -DSUPPORT_DHCP
521.1SthorpejCPPFLAGS+= -DSUPPORT_TFTP
531.1SthorpejCPPFLAGS+= -DSUPPORT_NFS
541.5Sdrochner#CPPFLAGS+= -DNFS_NOSYMLINK
551.1Sthorpej
561.1SthorpejCPPFLAGS+= -DPASS_MEMMAP
571.13SsaloCPPFLAGS+= -DEPIA_HACK
581.1Sthorpej
591.18Sdrochner# modules and boot.cfg need special DHCP server setup, disable
601.18Sdrochner# per default for compatibility with existing setups
611.20SdrochnerCPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0x0c
621.18Sdrochner
631.1Sthorpej#CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
641.1SthorpejCFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
651.1Sthorpej
661.28SgsonSAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x40000
671.2SthorpejSAMISCMAKEFLAGS+= SA_USE_CREAD=yes	# Read compressed kernels
681.1Sthorpej
691.7SdbjCPPFLAGS+= -DPASS_BIOSGEOM
701.7Sdbj# if you don't use -DPASS_BIOSGEOM, then set I386_INCLUDE_DISK=no
711.7Sdbj#I386MISCMAKEFLAGS= I386_INCLUDE_DISK=no
721.1Sthorpej
731.3Sthorpej.if (${BASE} == "pxeboot_ia32")
741.1SthorpejVERSIONFILE= ${.CURDIR}/version
751.3Sthorpej.else
761.3SthorpejVERSIONFILE= ${.CURDIR}/../pxeboot/version
771.3Sthorpej.endif
781.1Sthorpej
791.1Sthorpej.include "../Makefile.booters"
801.14She
811.14Sherelease: check_RELEASEDIR
821.14She	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
831.27Schristos		${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc
84