xref: /openbsd/sys/arch/alpha/stand/netboot/Makefile (revision 71e7d8aa)
1*71e7d8aaSderaadt#	$OpenBSD: Makefile,v 1.20 2024/01/28 01:07:26 deraadt Exp $
2dfe00690Smillert#	$NetBSD: Makefile,v 1.11 1997/04/17 07:27:50 thorpej Exp $
350ce9ee0Sniklas
4dfe00690SmillertS=	${.CURDIR}/../../../..
550ce9ee0Sniklas
6dfe00690Smillert.PATH: ${.CURDIR}/.. ${.CURDIR}/../boot
7dfe00690Smillert
8dfe00690SmillertPROG = netboot
9dfe00690Smillert
10dfe00690SmillertSRCS = start.S boot.c prom.c prom_disp.S OSFpal.c prom_swpal.S
11dfe00690SmillertSRCS+= rpcc.S
12dfe00690SmillertSRCS+= dev_net.c conf.c devopen.c
130cfa65d9SmiodSRCS+= if_prom.c getsecs.c
140cfa65d9SmiodSRCS+= loadfile_subr.c
15dfe00690SmillertNOMAN=
16dfe00690SmillertINSTALL_STRIP=
17dfe00690SmillertBINMODE= 444
18dfe00690Smillert
1950ce9ee0SniklasBOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
2050ce9ee0Sniklas
21e6a1c3c0SmiodCLEANFILES+= vers.c vers.o ${PROG}.sym ${PROG}.nosym ${PROG}.mop
2250ce9ee0Sniklas
234d6af78aSderaadt.PATH:  ${S}/lib/libkern/arch/alpha ${S}/lib/libkern
247faf7838SderaadtSRCS+=  bzero.c __divqu.S strlen.c __remqu.S __remq.S __remlu.S
254d6af78aSderaadt
260cfa65d9Smiod.PATH:	${S}/lib/libkern/arch/alpha ${S}/lib/libsa
27f65494e6SderaadtSRCS+=	loadfile.c arc4.c
280cfa65d9Smiod
290cfa65d9SmiodDEFNS= -DPRIMARY_BOOTBLOCK -DSUN_BOOTPARAMS
3050ce9ee0Sniklas
31d9e380a6SpascalAFLAGS += -DASSEMBLER ${DEFNS} -fno-pie
32dfe00690SmillertCPPFLAGS += -I${.CURDIR}/../.. -I${S} ${DEFNS}
33*71e7d8aaSderaadtCFLAGS = -Werror -mno-fp-regs -fno-pie -fno-stack-protector
3450ce9ee0Sniklas
35dfe00690Smillert${PROG}.nosym: ${PROG}.sym
36dfe00690Smillert	cp ${PROG}.sym ${PROG}.nosym
37e6a1c3c0Smiod	${STRIP} ${PROG}.nosym
3850ce9ee0Sniklas
3985382c84Smiod${PROG} ${PROG}.mop: ${PROG}.nosym
40e6a1c3c0Smiod	${OBJCOPY} --output-target=binary ${PROG}.nosym ${PROG}
4185382c84Smiod	mopa.out ${PROG}.nosym ${PROG}.mop
4285382c84Smiod
4385382c84Smiodrealinstall:
44d125f366Skn	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} \
4585382c84Smiod	    -o ${BINOWN} -g ${BINGRP} \
4685382c84Smiod	    -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROG}
47d125f366Skn	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} \
4885382c84Smiod	    -o ${BINOWN} -g ${BINGRP} \
4985382c84Smiod	    -m ${BINMODE} ${PROG}.mop ${DESTDIR}${BINDIR}/${PROG}.mop
50dfe00690Smillert
51dfe00690Smillert.include <bsd.prog.mk>
52dfe00690Smillert
53dfe00690Smillert### find out what to use for libz
54dfe00690SmillertZ_AS=		library
55dfe00690SmillertZDST=		${.CURDIR}/../libz/${__objdir}
56dfe00690Smillert.include "${.CURDIR}/../libz/Makefile.inc"
57dfe00690SmillertLIBZ=		${ZLIB}
58dfe00690Smillert
59dfe00690Smillert### find out what to use for libsa
60dfe00690SmillertSA_AS=		library
61dfe00690SmillertSADST=		${.CURDIR}/../libsa/${__objdir}
62dfe00690SmillertSAREL=
63dfe00690SmillertSA_ZLIB=	yes
64dfe00690Smillert.include "${.CURDIR}/../libsa/Makefile.inc"
65dfe00690SmillertLIBSA=		${SALIB}
66dfe00690Smillert
674d6af78aSderaadt${PROG}.sym: ${OBJS} ${LIBSA} ${LIBZ}
6850ce9ee0Sniklas	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version
6950ce9ee0Sniklas	${COMPILE.c} vers.c
705a5a41c0Sguenther	${LD} -nopie -znorelro -Ttext ${BOOT_RELOC} -N -e start \
715a5a41c0Sguenther	    -o ${PROG}.sym ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBSA}
72dfe00690Smillert	size ${PROG}.sym
73