Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / amiga / stand / bootblock / bootxx_ffs / Makefile
blob2ac428d0da00be0394c620b1543425ec10f43ade
1 # $NetBSD: Makefile,v 1.11 2009/01/12 07:42:30 tsutsui Exp $
3 ### what we need:
5 DIR_TOP= ${.CURDIR}/../../../../..
6 DIR_SA = ${DIR_TOP}/lib/libsa
7 DIR_KERN= ${DIR_TOP}/lib/libkern
8 DIR_KERN_MD= ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
9 DIR_LIBC= ${DIR_TOP}/../common/lib/libc
11 .PATH: ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) \
12 ${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
13 ${DIR_LIBC}/inet ${DIR_LIBC}/arch/m68k/inet \
14 ${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \
15 ${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string
18 # prefer our assembler versions over assembler, and assembler over C:
20 .SUFFIXES:
21 .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
23 FILES= bootxx_ffs bootxx_fd
24 BINDIR=/usr/mdec
26 COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
27 COBJS+= lseek.o open.o read.o close.o dev.o errno.o
28 COBJS+= ufs.o ustarfs.o panic.o vers.o files.o
30 SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
31 SOBJS += strlen.o strcmp.o fstat.o
32 SOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o
34 OBJS= $(SOBJS) $(COBJS)
36 DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -D_PRIMARY_BOOT
38 .NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o
40 ### main target: ###
42 realall: machine m68k ${FILES}
44 CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k
46 .include <bsd.prog.mk>
48 ### special rules for bootblocks ###
50 INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
51 INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
52 INCPATH += -I${.CURDIR}/../aout2bb -I${.OBJDIR}
54 AFLAGS += -m68030 -l
55 CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT
57 COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030
58 CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
60 NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh
61 DEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
63 # Use small daddr_t to avoid code bloat
64 DEFS+= -D__daddr_t=int32_t
66 .c.o:
67 ${CC} ${CFLAGS} -S $< -o $*.s
68 ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
69 rm $*.s
71 .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
73 .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
75 bootxx_ffs: x.out
76 ${RELOC2BB} x.out $@ || ${NM} -u x.out
78 bootxx_fd: f.out
79 ${RELOC2BB} -F f.out $@ || ${NM} -u f.out
81 x.out: xxstart.o libboot.a
82 ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
83 ${SIZE} $@
84 ${NM} -u $@
86 f.out: fdstart.o libboot.a
87 ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
88 ${SIZE} $@
89 ${NM} -u $@
91 xxstart.o: ${.CURDIR}/../boot/bbstart.s
92 ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
93 -o $@ -c $>
95 fdstart.o: ${.CURDIR}/../boot//bbstart.s
96 ${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
97 -o $@ -c $>
99 libboot.a: ${OBJS}
100 ${AR} r $@ $> && ${RANLIB} $@
102 .PHONY: vers.c
103 vers.c: ${.CURDIR}/../boot/version
104 ${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga"
106 .if !make(obj) && !make(clean) && !make(cleandir)
107 .NOPATH: machine m68k
108 .BEGIN: machine m68k
110 machine:
111 -rm -f $@
112 ln -s ${DIR_TOP}/arch/amiga/include $@
114 m68k:
115 -rm -f $@
116 ln -s ${DIR_TOP}/arch/m68k/include $@
117 .endif
119 # make sure these are built:
121 ${COBJS}: ${TXLT}
122 ${FILES}: ${RELOC2BB}
124 .include "${.CURDIR}/../Makefile.booters"