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