1 1.4 thorpej # $NetBSD: Makefile,v 1.4 2002/05/31 20:57:42 thorpej Exp $ 2 1.1 mhitch 3 1.1 mhitch ### what we need: 4 1.1 mhitch 5 1.1 mhitch DIR_TOP= ${.CURDIR}/../../../../.. 6 1.1 mhitch DIR_SA = ${DIR_TOP}/lib/libsa 7 1.1 mhitch DIR_KERN= ${DIR_TOP}/lib/libkern 8 1.1 mhitch DIR_KERN_MD= ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH) 9 1.1 mhitch 10 1.1 mhitch .PATH: ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) 11 1.1 mhitch 12 1.1 mhitch # prefer our assembler versions over assembler, and assembler over C: 13 1.1 mhitch 14 1.1 mhitch .SUFFIXES: 15 1.1 mhitch .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 16 1.1 mhitch 17 1.1 mhitch FILES= bootxx_ffs bootxx_fd 18 1.1 mhitch BINDIR=/usr/mdec 19 1.1 mhitch 20 1.1 mhitch COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o 21 1.1 mhitch COBJS+= lseek.o open.o read.o close.o dev.o errno.o 22 1.3 mhitch COBJS+= ufs.o ustarfs.o panic.o vers.o files.o 23 1.1 mhitch 24 1.1 mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o 25 1.1 mhitch SOBJS += strlen.o strcmp.o fstat.o 26 1.1 mhitch SOBJS += libstubs.o memset.o strncmp.o 27 1.1 mhitch 28 1.1 mhitch OBJS= $(SOBJS) $(COBJS) 29 1.1 mhitch 30 1.1 mhitch DEFS = -D_STANDALONE -DINSECURE -D_PRIMARY_BOOT 31 1.1 mhitch 32 1.1 mhitch .NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o 33 1.1 mhitch 34 1.1 mhitch ### main target: ### 35 1.1 mhitch 36 1.1 mhitch realall: machine m68k ${FILES} 37 1.1 mhitch 38 1.1 mhitch CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k 39 1.1 mhitch 40 1.1 mhitch .include <bsd.prog.mk> 41 1.1 mhitch 42 1.1 mhitch ### special rules for bootblocks ### 43 1.1 mhitch 44 1.1 mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} 45 1.1 mhitch INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../.. 46 1.1 mhitch INCPATH += -I${.CURDIR}/../aout2bb -I$(.CURDIR) -I${DESTDIR}/usr/include 47 1.1 mhitch 48 1.1 mhitch AFLAGS += -m68030 -l 49 1.1 mhitch CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT 50 1.1 mhitch 51 1.1 mhitch COPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 52 1.4 thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes 53 1.1 mhitch 54 1.1 mhitch NETBSD_VERS!= sh ${.CURDIR}/../../../../../conf/osrelease.sh 55 1.1 mhitch DEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 56 1.1 mhitch 57 1.1 mhitch .c.o: 58 1.1 mhitch ${CC} ${CFLAGS} -S $< -o $*.s 59 1.1 mhitch ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o 60 1.1 mhitch rm $*.s 61 1.1 mhitch 62 1.1 mhitch .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 63 1.1 mhitch 64 1.1 mhitch .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 65 1.1 mhitch 66 1.1 mhitch bootxx_ffs: x.out 67 1.1 mhitch ${RELOC2BB} x.out $@ || ${NM} -u x.out 68 1.1 mhitch 69 1.1 mhitch bootxx_fd: f.out 70 1.1 mhitch ${RELOC2BB} -F f.out $@ || ${NM} -u f.out 71 1.1 mhitch 72 1.1 mhitch x.out: xxstart.o libboot.a 73 1.1 mhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 74 1.1 mhitch ${SIZE} $@ 75 1.1 mhitch ${NM} -u $@ 76 1.1 mhitch 77 1.1 mhitch f.out: fdstart.o libboot.a 78 1.1 mhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 79 1.1 mhitch ${SIZE} $@ 80 1.1 mhitch ${NM} -u $@ 81 1.1 mhitch 82 1.1 mhitch xxstart.o: ${.CURDIR}/../boot/bbstart.s 83 1.1 mhitch ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 84 1.1 mhitch -o $@ -c $> 85 1.1 mhitch 86 1.1 mhitch fdstart.o: ${.CURDIR}/../boot//bbstart.s 87 1.1 mhitch ${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 88 1.1 mhitch -o $@ -c $> 89 1.1 mhitch 90 1.1 mhitch libboot.a: ${OBJS} 91 1.1 mhitch ${AR} r $@ $> && ${RANLIB} $@ 92 1.1 mhitch 93 1.1 mhitch .PHONY: vers.c 94 1.1 mhitch vers.c: ${.CURDIR}/../boot/version 95 1.1 mhitch sh ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga" 96 1.1 mhitch 97 1.1 mhitch machine: 98 1.1 mhitch -rm -f $@ 99 1.1 mhitch ln -s ${DIR_TOP}/arch/amiga/include $@ 100 1.1 mhitch 101 1.1 mhitch m68k: 102 1.1 mhitch -rm -f $@ 103 1.1 mhitch ln -s ${DIR_TOP}/arch/m68k/include $@ 104 1.1 mhitch 105 1.1 mhitch # make sure these are built: 106 1.1 mhitch 107 1.1 mhitch ${COBJS}: ${TXLT} 108 1.1 mhitch ${FILES}: ${RELOC2BB} 109 1.2 aymeric 110 1.2 aymeric .include "${.CURDIR}/../Makefile.booters" 111