Makefile revision 1.11
1#	$NetBSD: Makefile,v 1.11 2002/05/07 09:03:52 jdolecek Exp $
2
3S=	${.CURDIR}/../../../..
4
5### find out what to use for libkern
6KERN_AS=        library
7.include "${S}/lib/libkern/Makefile.inc"
8#LIBKERN=        ${KERNLIB}
9
10### find out what to use for libz
11Z_AS=           library
12.include "${S}/lib/libz/Makefile.inc"
13#LIBZ=           ${ZLIB}
14
15### find out what to use for libsa
16SA_AS=          library
17SAMISCMAKEFLAGS= SA_USE_LOADFILE=yes # SA_USE_CREAD=yes
18.include "${S}/lib/libsa/Makefile.inc"
19#LIBSA=          ${SALIB}
20
21RELOC=	4380000
22
23# XXX make defs arch-indep.
24INCLUDES+=	-I${.CURDIR} -I${.CURDIR}/obj.${MACHINE} -I${S}/arch -I${S} -I${S}/lib/libsa -I${S}/lib/libkern
25DEFS+=		-D_STANDALONE -DMC68040 -DSUPPORT_BOOTP -DSUPPORT_DHCP  -DDEBUG -DSD_DEBUG -DSCSI_DEBUG # -DEN_DEBUG   -DNETIF_DEBUG  
26SAMISCCPPFLAGS=	-DSUPPORT_DHCP -DSUPPORT_BOOTP -DINSECURE # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG  -DARP_DEBUG 
27WARNS=1
28CFLAGS+=	 -ffreestanding -nostdinc ${INCLUDES} ${DEFS}
29LIBCRT0=
30
31PROG=	boot
32SRCS=   boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c vers.c build.c
33# @@@ dev_net.c should really be in libsa, but it doesn't
34# declare ip_convertaddr correctly, so I put it here _temporarily_.
35
36CLEANFILES+= srt0.o boot.elf boot.raw machine ${MACHINE_ARCH} limits.h
37CLEANFILES+= vers.c build.c build	# generated dynamically
38
39NOMAN=	# defined
40BINDIR=	/usr/mdec
41#LIBS=	${SALIB} ${KERNLIB} ${ZLIB}
42LIBS=	${SALIB} ${KERNLIB}
43
44OBJS+=	dev_net.o
45
46AWKPROG='\
47function x(v) { printf "\0%c%c%c", v / 65536, v / 256, v } \
48{ \
49	printf "\0\207\01\07"; \
50	x($$1); \
51	x($$2); \
52	x($$3); \
53	printf "\0\0\0\0\04\070\0\0\0\0\0\0\0\0\0\0" \
54}'
55
56${PROG}: srt0.o ${OBJS} ${LIBS}
57	${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf
58	@${SIZE} $@.elf
59	@${OBJCOPY} -O binary $@.elf $@.raw
60	@(${SIZE} $@.elf | tail +2 | awk ${AWKPROG} ; cat $@.raw) > $@
61
62# this looks useful to me ... let's see when it will be an official part
63# of libsa
64dev_net.o : ${S}/lib/libsa/dev_net.c
65	${COMPILE.c} ${.IMPSRC}
66
67# startup
68
69srt0.o: ${.CURDIR}/srt0.s
70	${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s
71
72.PHONY: build.c
73build.c:
74	sh ${.CURDIR}/newvers.sh
75
76vers.c: version
77	sh ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "next68k"
78
79#installboot: ${.CURDIR}/installboot.sh
80#	@rm -f installboot
81#	cp -p ${.CURDIR}/installboot.sh installboot
82
83# utilities
84
85.if !make(obj) && !make(clean) && !make(cleandir)
86.BEGIN:
87	rm -f machine
88	ln -s ${S}/arch/${MACHINE}/include machine
89	rm -f ${MACHINE_ARCH}
90	ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH}
91.endif
92
93.include <bsd.prog.mk>
94