1 1.33 mhitch # $NetBSD: Makefile,v 1.33 2003/10/25 03:14:33 mhitch Exp $ 2 1.1 is 3 1.2 is ### what we need: 4 1.1 is 5 1.10 is DIR_TOP= ${.CURDIR}/../../../../.. 6 1.10 is DIR_SA = ${DIR_TOP}/lib/libsa 7 1.24 mhitch DIR_LIBZ = ${DIR_TOP}/lib/libz 8 1.10 is DIR_KERN= ${DIR_TOP}/lib/libkern 9 1.10 is DIR_KERN_MD= ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH) 10 1.1 is 11 1.24 mhitch .PATH: $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD) 12 1.1 is 13 1.2 is # prefer our assembler versions over assembler, and assembler over C: 14 1.1 is 15 1.2 is .SUFFIXES: 16 1.2 is .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 17 1.1 is 18 1.24 mhitch FILES= boot.amiga 19 1.13 veego BINDIR=/usr/mdec 20 1.1 is 21 1.15 is COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o 22 1.19 is COBJS+= lseek.o open.o read.o close.o dev.o errno.o 23 1.27 mhitch COBJS+= ufs.o ustarfs.o panic.o vers.o files.o 24 1.30 mhitch COBJS+= divdi3.o moddi3.o qdivrem.o snprintf.o 25 1.1 is 26 1.23 mhitch SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o 27 1.24 mhitch SOBJS += strlen.o strcmp.o memcmp.o strerror.o sprintf.o subr_prf.o 28 1.32 he SOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o 29 1.1 is 30 1.2 is OBJS= $(SOBJS) $(COBJS) 31 1.1 is 32 1.17 is DEFS = -D_STANDALONE -DINSECURE 33 1.24 mhitch DEFS += -D__INTERNAL_LIBSA_CREAD 34 1.24 mhitch SOBJS += cread.o 35 1.31 he SOBJS += crc32.o inflate.o infblock.o infcodes.o inftrees.o # XXX need libz!!! 36 1.24 mhitch SOBJS += inffast.o infutil.o 37 1.25 aymeric #DEFS += -DBOOT_ELF32 -DBOOT_AOUT 38 1.24 mhitch SOBJS += loadfile.o loadfile_aout.o loadfile_elf32.o 39 1.24 mhitch 40 1.24 mhitch NETBSD_VERS!= sh ${.CURDIR}/../../../../../conf/osrelease.sh 41 1.24 mhitch DEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 42 1.1 is 43 1.2 is ### main target: ### 44 1.1 is 45 1.24 mhitch realall: machine m68k ${FILES} 46 1.24 mhitch 47 1.24 mhitch CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c machine m68k 48 1.1 is 49 1.18 tron .include <bsd.prog.mk> 50 1.18 tron 51 1.2 is ### special rules for bootblocks ### 52 1.1 is 53 1.24 mhitch INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} 54 1.24 mhitch INCPATH += -I${.CURDIR}/../../.. -I${.OBJDIR} 55 1.24 mhitch INCPATH += -I${.CURDIR}/../aout2bb -I${DESTDIR}/usr/include 56 1.10 is 57 1.2 is AFLAGS += -m68030 -l 58 1.10 is CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} 59 1.1 is 60 1.33 mhitch COPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 61 1.29 thorpej CFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes 62 1.1 is 63 1.2 is .c.o: 64 1.18 tron ${CC} ${CFLAGS} -S $< -o $*.s 65 1.18 tron ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o 66 1.2 is rm $*.s 67 1.1 is 68 1.18 tron .s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 69 1.1 is 70 1.18 tron .S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 71 1.1 is 72 1.24 mhitch boot.amiga: x.out 73 1.27 mhitch ${RELOC2BB} -S x.out $@ || ${NM} -u x.out 74 1.2 is 75 1.2 is x.out: xxstart.o libboot.a 76 1.18 tron ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 77 1.22 mhitch ${SIZE} $@ 78 1.22 mhitch ${NM} -u $@ 79 1.2 is 80 1.2 is xxstart.o: ${.CURDIR}/bbstart.s 81 1.18 tron ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 82 1.2 is -o $@ -c $> 83 1.2 is 84 1.18 tron libboot.a: ${OBJS} 85 1.18 tron ${AR} r $@ $> && ${RANLIB} $@ 86 1.2 is 87 1.24 mhitch .PHONY: vers.c 88 1.24 mhitch vers.c: ${.CURDIR}/version 89 1.24 mhitch sh ${DIR_TOP}/conf/newvers_stand.sh -N ${.CURDIR}/version "amiga" 90 1.24 mhitch 91 1.24 mhitch machine: 92 1.24 mhitch -rm -f $@ 93 1.24 mhitch ln -s ${DIR_TOP}/arch/amiga/include $@ 94 1.24 mhitch 95 1.24 mhitch m68k: 96 1.24 mhitch -rm -f $@ 97 1.24 mhitch ln -s ${DIR_TOP}/arch/m68k/include $@ 98 1.24 mhitch 99 1.10 is # make sure these are built: 100 1.2 is 101 1.10 is ${COBJS}: ${TXLT} 102 1.24 mhitch ${FILES}: ${RELOC2BB} 103 1.26 aymeric 104 1.26 aymeric .include "${.CURDIR}/../Makefile.booters" 105