Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / next68k / stand / boot / Makefile
blob48469ba23f821740b02c9408ed37e32639545205
1 # $NetBSD: Makefile,v 1.22 2009/01/12 07:47:47 tsutsui Exp $
3 NOMAN= # defined
5 S= ${.CURDIR}/../../../..
7 ### find out what to use for libkern
8 KERN_AS= library
9 .include "${S}/lib/libkern/Makefile.inc"
10 #LIBKERN= ${KERNLIB}
12 ### find out what to use for libz
13 Z_AS= library
14 .include "${S}/lib/libz/Makefile.inc"
15 #LIBZ= ${ZLIB}
17 ### find out what to use for libsa
18 SA_AS= library
19 SAMISCMAKEFLAGS= SA_USE_LOADFILE=yes # SA_USE_CREAD=yes
20 .include "${S}/lib/libsa/Makefile.inc"
21 #LIBSA= ${SALIB}
23 RELOC= 4380000
25 # XXX make defs arch-indep.
26 INCLUDES+= -I${.OBJDIR} -I${S}/arch -I${S} -I${S}/lib/libsa
27 DEFS+= -D_STANDALONE -DMC68040 -DSUPPORT_BOOTP -DSUPPORT_DHCP -DDEBUG -DSD_DEBUG -DSCSI_DEBUG # -DEN_DEBUG -DNETIF_DEBUG
28 SAMISCCPPFLAGS= -DSUPPORT_DHCP -DSUPPORT_BOOTP -DSA_EXEC_ANYOWNER # -DBOOTP_DEBUG -DETHER_DEBUG -DNET_DEBUG # -DNETIF_DEBUG -DNFS_DEBUG -DARP_DEBUG
29 WARNS=1
30 CFLAGS+= -ffreestanding -nostdinc ${INCLUDES} ${DEFS}
31 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
32 AFLAGS+= ${INCLUDES}
33 # XXX SHOULD NOT NEED TO DEFINE THESE!
34 LIBCRT0=
35 LIBC=
36 LIBCRTBEGIN=
37 LIBCRTEND=
39 PROG= boot
40 SRCS= boot.c machdep.c conf.c devopen.c rtc.c sd.c scsi.c en.c vers.c build.c
42 # @@@ dev_net.c should really be in libsa, but it doesn't
43 # declare ip_convertaddr correctly, so I put it here _temporarily_.
44 .PATH: ${S}/lib/libsa
45 SRCS+= dev_net.c
47 CLEANFILES+= srt0.o boot.elf boot.raw machine ${MACHINE_ARCH} limits.h
48 CLEANFILES+= vers.c build.c build # generated dynamically
50 BINDIR= /usr/mdec
51 #LIBS= ${SALIB} ${KERNLIB} ${ZLIB}
52 LIBS= ${SALIB} ${KERNLIB}
54 # do not strip ${PROG} on install
55 STRIPFLAG= # defined
57 AWKPROG='\
58 function x(v) { printf "\\0\\%o\\%o\\%o", (v / 65536) % 256, (v / 256) % 256, v % 256 } \
59 { \
60 printf "\047\\0\\207\\01\\07"; \
61 x($$1); \
62 x($$2); \
63 x($$3); \
64 printf "\\0\\0\\0\\0\\04\\070\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\047" \
67 ${PROG}: srt0.o ${OBJS} ${LIBS}
68 ${LD} -N -Ttext ${RELOC} -e start srt0.o ${OBJS} ${LIBS} -o $@.elf
69 ${SIZE} $@.elf
70 ${OBJCOPY} -O binary $@.elf $@.raw
71 (${SIZE} $@.elf | tail +2 | ${TOOL_AWK} ${AWKPROG} | \
72 xargs printf ; cat $@.raw) > $@
74 # startup
76 srt0.o: ${.CURDIR}/srt0.s
77 ${CC} -m68040 -x assembler-with-cpp ${INCLUDES} ${DEFS} -c ${.CURDIR}/srt0.s
79 .PHONY: build.c
80 build.c:
81 ${HOST_SH} ${.CURDIR}/newvers.sh
83 vers.c: version
84 ${HOST_SH} ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "next68k"
86 #installboot: ${.CURDIR}/installboot.sh
87 # @rm -f installboot
88 # cp -p ${.CURDIR}/installboot.sh installboot
90 # utilities
92 .if !make(obj) && !make(clean) && !make(cleandir)
93 .NOPATH: machine ${MACHINE_ARCH}
94 .BEGIN: machine ${MACHINE_ARCH}
96 machine:
97 -rm -f machine
98 ln -s ${S}/arch/${MACHINE}/include machine
100 ${MACHINE_ARCH}:
101 -rm -f ${MACHINE_ARCH}
102 ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH}
103 .endif
105 .include <bsd.prog.mk>