Makefile revision 1.18
1#	$NetBSD: Makefile,v 1.18 2021/03/24 02:53:16 rin Exp $
2
3S=		${.CURDIR}/../../../..
4
5PROG=		altboot
6FILES+=		${PROG}.bin ${PROG}.img
7NOMAN=		# defined
8SRCS=		entry.S main.c brdsetup.c pci.c devopen.c dev_net.c memfs.c
9SRCS+=		nif.c fxp.c tlp.c rge.c skg.c stg.c
10SRCS+=		dsk.c pciide.c siisata.c
11SRCS+=		exception.c
12CLEANFILES+=	${PROG} ${PROG}.bin ${PROG}.img
13CFLAGS+=	-Wall -Wno-main -ffreestanding
14CFLAGS+=	${${ACTIVE_CC} == "gcc":? -msoft-float :}
15CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
16CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -DLIBSA_PRINTF_WIDTH_SUPPORT
17#CPPFLAGS+=	-DCONSNAME=\"com\" -DCONSPORT=0x3f8 -DCONSSPEED=115200
18#CPPFLAGS+=	-DCONSNAME=\"eumb\" -DCONSPORT=0x4600 -DCONSSPEED=57600
19CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S}
20DBG=		-Os
21
22.include <bsd.own.mk>
23.include <bsd.klinks.mk>
24
25# XXX SHOULD NOT NEED TO DEFINE THESE!
26LIBCRT0=
27LIBCRTI=
28LIBC=
29LIBCRTBEGIN=
30LIBCRTEND=
31
32STRIPFLAG=
33BINMODE=	444
34
35RELOC=		1000000
36ENTRY=		_start
37
38### find out what to use for libkern
39KERN_AS=	library
40.include "${S}/lib/libkern/Makefile.inc"
41LIBKERN=	${KERNLIB}
42
43### find out what to use for libz
44Z_AS=		library
45.include "${S}/lib/libz/Makefile.inc"
46LIBZ=		${ZLIB}
47
48### find out what to use for libsa
49SA_AS=		library
50SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
51.include "${S}/lib/libsa/Makefile.inc"
52LIBSA=		${SALIB}
53
54cleandir distclean: .WAIT cleanlibdir
55
56cleanlibdir:
57	-rm -rf lib
58
59${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
60	${_MKTARGET_LINK}
61	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
62	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
63	${OBJCOPY} -S -O binary ${PROG} ${PROG}.bin
64	${TOOL_MKUBOOTIMAGE} -A powerpc -T kernel -C none -O linux \
65	    -a 0x${RELOC} -n ${PROG} ${PROG}.bin ${PROG}.img
66
67VERSIONFLAGS+=-k
68.include "${S}/conf/newvers_stand.mk"
69
70.include <bsd.prog.mk>
71