Makefile revision 1.5
11.5Smhitch# $NetBSD: Makefile,v 1.5 2003/02/03 07:17:13 mhitch Exp $ 21.1Smhitch 31.1Smhitch### what we need: 41.1Smhitch 51.1SmhitchDIR_TOP= ${.CURDIR}/../../../../.. 61.1SmhitchDIR_SA = ${DIR_TOP}/lib/libsa 71.1SmhitchDIR_KERN= ${DIR_TOP}/lib/libkern 81.1SmhitchDIR_KERN_MD= ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH) 91.1Smhitch 101.1Smhitch.PATH: ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) 111.1Smhitch 121.1Smhitch# prefer our assembler versions over assembler, and assembler over C: 131.1Smhitch 141.1Smhitch.SUFFIXES: 151.1Smhitch.SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 161.1Smhitch 171.1SmhitchFILES= bootxx_ffs bootxx_fd 181.1SmhitchBINDIR=/usr/mdec 191.1Smhitch 201.1SmhitchCOBJS = main.o console.o xd.o twiddle.o bzero.o gets.o 211.1SmhitchCOBJS+= lseek.o open.o read.o close.o dev.o errno.o 221.3SmhitchCOBJS+= ufs.o ustarfs.o panic.o vers.o files.o 231.1Smhitch 241.1SmhitchSOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o 251.1SmhitchSOBJS += strlen.o strcmp.o fstat.o 261.1SmhitchSOBJS += libstubs.o memset.o strncmp.o 271.1Smhitch 281.1SmhitchOBJS= $(SOBJS) $(COBJS) 291.1Smhitch 301.1SmhitchDEFS = -D_STANDALONE -DINSECURE -D_PRIMARY_BOOT 311.1Smhitch 321.1Smhitch.NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o 331.1Smhitch 341.1Smhitch### main target: ### 351.1Smhitch 361.1Smhitchrealall: machine m68k ${FILES} 371.1Smhitch 381.1SmhitchCLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k 391.1Smhitch 401.1Smhitch.include <bsd.prog.mk> 411.1Smhitch 421.1Smhitch### special rules for bootblocks ### 431.1Smhitch 441.1SmhitchINCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} 451.1SmhitchINCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../.. 461.1SmhitchINCPATH += -I${.CURDIR}/../aout2bb -I$(.CURDIR) -I${DESTDIR}/usr/include 471.1Smhitch 481.1SmhitchAFLAGS += -m68030 -l 491.1SmhitchCAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT 501.1Smhitch 511.1SmhitchCOPTIM= -O -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 521.4SthorpejCFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes 531.1Smhitch 541.1SmhitchNETBSD_VERS!= sh ${.CURDIR}/../../../../../conf/osrelease.sh 551.1SmhitchDEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 561.5Smhitch 571.5Smhitch# Use small daddr_t to avoid code bloat 581.5SmhitchDEFS+= -D__daddr_t=int32_t 591.1Smhitch 601.1Smhitch.c.o: 611.1Smhitch ${CC} ${CFLAGS} -S $< -o $*.s 621.1Smhitch ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o 631.1Smhitch rm $*.s 641.1Smhitch 651.1Smhitch.s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 661.1Smhitch 671.1Smhitch.S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 681.1Smhitch 691.1Smhitchbootxx_ffs: x.out 701.1Smhitch ${RELOC2BB} x.out $@ || ${NM} -u x.out 711.1Smhitch 721.1Smhitchbootxx_fd: f.out 731.1Smhitch ${RELOC2BB} -F f.out $@ || ${NM} -u f.out 741.1Smhitch 751.1Smhitchx.out: xxstart.o libboot.a 761.1Smhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 771.1Smhitch ${SIZE} $@ 781.1Smhitch ${NM} -u $@ 791.1Smhitch 801.1Smhitchf.out: fdstart.o libboot.a 811.1Smhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 821.1Smhitch ${SIZE} $@ 831.1Smhitch ${NM} -u $@ 841.1Smhitch 851.1Smhitchxxstart.o: ${.CURDIR}/../boot/bbstart.s 861.1Smhitch ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 871.1Smhitch -o $@ -c $> 881.1Smhitch 891.1Smhitchfdstart.o: ${.CURDIR}/../boot//bbstart.s 901.1Smhitch ${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 911.1Smhitch -o $@ -c $> 921.1Smhitch 931.1Smhitchlibboot.a: ${OBJS} 941.1Smhitch ${AR} r $@ $> && ${RANLIB} $@ 951.1Smhitch 961.1Smhitch.PHONY: vers.c 971.1Smhitchvers.c: ${.CURDIR}/../boot/version 981.1Smhitch sh ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga" 991.1Smhitch 1001.1Smhitchmachine: 1011.1Smhitch -rm -f $@ 1021.1Smhitch ln -s ${DIR_TOP}/arch/amiga/include $@ 1031.1Smhitch 1041.1Smhitchm68k: 1051.1Smhitch -rm -f $@ 1061.1Smhitch ln -s ${DIR_TOP}/arch/m68k/include $@ 1071.1Smhitch 1081.1Smhitch# make sure these are built: 1091.1Smhitch 1101.1Smhitch${COBJS}: ${TXLT} 1111.1Smhitch${FILES}: ${RELOC2BB} 1121.2Saymeric 1131.2Saymeric.include "${.CURDIR}/../Makefile.booters" 114