xref: /openbsd/sys/arch/alpha/stand/netboot/Makefile (revision 0cfa65d9)
1*0cfa65d9Smiod#	$OpenBSD: Makefile,v 1.10 2011/06/05 21:49:36 miod 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
13*0cfa65d9SmiodSRCS+= if_prom.c getsecs.c
14*0cfa65d9SmiodSRCS+= loadfile_subr.c
15dfe00690SmillertNOMAN=
16dfe00690SmillertINSTALL_STRIP=
17dfe00690SmillertBINMODE= 444
18dfe00690Smillert
1950ce9ee0SniklasBOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
2050ce9ee0Sniklas
21*0cfa65d9SmiodCLEANFILES+= vers.c vers.o ${PROG}.sym ${PROG}.nosym
2250ce9ee0Sniklas
234d6af78aSderaadt.PATH:  ${S}/lib/libkern/arch/alpha ${S}/lib/libkern
24e3afee03SmartinSRCS+=  bzero.c __divqu.S strlen.c __remqu.S
254d6af78aSderaadt
26*0cfa65d9Smiod.PATH:	${S}/lib/libkern/arch/alpha ${S}/lib/libsa
27*0cfa65d9SmiodSRCS+=	loadfile.c
28*0cfa65d9Smiod
29*0cfa65d9SmiodDEFNS= -DPRIMARY_BOOTBLOCK -DSUN_BOOTPARAMS
3050ce9ee0Sniklas
31dfe00690SmillertAFLAGS += -DASSEMBLER ${DEFNS}
32dfe00690SmillertCPPFLAGS += -I${.CURDIR}/../.. -I${S} ${DEFNS}
33dfe00690SmillertCFLAGS = -Werror -mno-fp-regs
3450ce9ee0Sniklas
35dfe00690Smillert${PROG}.nosym: ${PROG}.sym
36dfe00690Smillert	cp ${PROG}.sym ${PROG}.nosym
37dfe00690Smillert	strip ${PROG}.nosym
3850ce9ee0Sniklas
39*0cfa65d9Smiod${PROG}: ${PROG}.nosym
4070ea782dSart	objcopy --output-target=binary ${PROG}.nosym ${PROG}
41dfe00690Smillert
42dfe00690Smillert# no lint here (yet?)
43dfe00690Smillertlint:
44dfe00690Smillert
45dfe00690Smillert.include <bsd.prog.mk>
46dfe00690Smillert
47dfe00690Smillert### find out what to use for libz
48dfe00690SmillertZ_AS=		library
49dfe00690SmillertZDST=		${.CURDIR}/../libz/${__objdir}
50dfe00690Smillert.include "${.CURDIR}/../libz/Makefile.inc"
51dfe00690SmillertLIBZ=		${ZLIB}
52dfe00690Smillert
53dfe00690Smillert### find out what to use for libsa
54dfe00690SmillertSA_AS=		library
55dfe00690SmillertSADST=		${.CURDIR}/../libsa/${__objdir}
56dfe00690SmillertSAREL=
57dfe00690SmillertSA_ZLIB=	yes
58dfe00690Smillert.include "${.CURDIR}/../libsa/Makefile.inc"
59dfe00690SmillertLIBSA=		${SALIB}
60dfe00690Smillert
614d6af78aSderaadt${PROG}.sym: ${OBJS} ${LIBSA} ${LIBZ}
6250ce9ee0Sniklas	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version
6350ce9ee0Sniklas	${COMPILE.c} vers.c
64dfe00690Smillert	${LD} -Ttext ${BOOT_RELOC} -N -e start -o ${PROG}.sym \
654d6af78aSderaadt	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBSA}
66dfe00690Smillert	size ${PROG}.sym
67