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