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