Makefile revision 1.11
11.11Stsutsui# $NetBSD: Makefile,v 1.11 2009/01/12 07:42:30 tsutsui 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.10SisDIR_LIBC= ${DIR_TOP}/../common/lib/libc 101.10Sis 111.10Sis.PATH: ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) \ 121.10Sis ${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \ 131.10Sis ${DIR_LIBC}/inet ${DIR_LIBC}/arch/m68k/inet \ 141.10Sis ${DIR_LIBC}/quad ${DIR_LIBC}/arch/m68k/quad \ 151.10Sis ${DIR_LIBC}/string ${DIR_LIBC}/arch/m68k/string 161.1Smhitch 171.1Smhitch 181.1Smhitch# prefer our assembler versions over assembler, and assembler over C: 191.1Smhitch 201.1Smhitch.SUFFIXES: 211.1Smhitch.SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 221.1Smhitch 231.1SmhitchFILES= bootxx_ffs bootxx_fd 241.1SmhitchBINDIR=/usr/mdec 251.1Smhitch 261.1SmhitchCOBJS = main.o console.o xd.o twiddle.o bzero.o gets.o 271.1SmhitchCOBJS+= lseek.o open.o read.o close.o dev.o errno.o 281.3SmhitchCOBJS+= ufs.o ustarfs.o panic.o vers.o files.o 291.1Smhitch 301.1SmhitchSOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o 311.1SmhitchSOBJS += strlen.o strcmp.o fstat.o 321.6SheSOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o 331.1Smhitch 341.1SmhitchOBJS= $(SOBJS) $(COBJS) 351.1Smhitch 361.1SmhitchDEFS = -D_STANDALONE -DINSECURE -D_PRIMARY_BOOT 371.1Smhitch 381.1Smhitch.NOPATH: ${OBJS} x.out f.out libboot.a xxstart.o 391.1Smhitch 401.1Smhitch### main target: ### 411.1Smhitch 421.1Smhitchrealall: machine m68k ${FILES} 431.1Smhitch 441.1SmhitchCLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c machine m68k 451.1Smhitch 461.1Smhitch.include <bsd.prog.mk> 471.1Smhitch 481.1Smhitch### special rules for bootblocks ### 491.1Smhitch 501.1SmhitchINCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} 511.1SmhitchINCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../.. 521.11StsutsuiINCPATH += -I${.CURDIR}/../aout2bb -I${.OBJDIR} 531.1Smhitch 541.1SmhitchAFLAGS += -m68030 -l 551.1SmhitchCAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} -D_PRIMARY_BOOT 561.1Smhitch 571.7SmhitchCOPTIM= -Os -fomit-frame-pointer -fcse-follow-jumps -fcse-skip-blocks -Wa,-l -m68060 -Wa,-m68030 581.4SthorpejCFLAGS= -ffreestanding ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes 591.1Smhitch 601.8SlukemNETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../../conf/osrelease.sh 611.1SmhitchDEFS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 621.5Smhitch 631.5Smhitch# Use small daddr_t to avoid code bloat 641.5SmhitchDEFS+= -D__daddr_t=int32_t 651.1Smhitch 661.1Smhitch.c.o: 671.1Smhitch ${CC} ${CFLAGS} -S $< -o $*.s 681.1Smhitch ${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o 691.1Smhitch rm $*.s 701.1Smhitch 711.1Smhitch.s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 721.1Smhitch 731.1Smhitch.S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $< 741.1Smhitch 751.1Smhitchbootxx_ffs: x.out 761.1Smhitch ${RELOC2BB} x.out $@ || ${NM} -u x.out 771.1Smhitch 781.1Smhitchbootxx_fd: f.out 791.1Smhitch ${RELOC2BB} -F f.out $@ || ${NM} -u f.out 801.1Smhitch 811.1Smhitchx.out: xxstart.o libboot.a 821.1Smhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 831.1Smhitch ${SIZE} $@ 841.1Smhitch ${NM} -u $@ 851.1Smhitch 861.1Smhitchf.out: fdstart.o libboot.a 871.1Smhitch ${LD} ${LDFLAGS} -r -dc -e _start -o $@ $> 881.1Smhitch ${SIZE} $@ 891.1Smhitch ${NM} -u $@ 901.1Smhitch 911.1Smhitchxxstart.o: ${.CURDIR}/../boot/bbstart.s 921.1Smhitch ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 931.1Smhitch -o $@ -c $> 941.1Smhitch 951.1Smhitchfdstart.o: ${.CURDIR}/../boot//bbstart.s 961.1Smhitch ${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \ 971.1Smhitch -o $@ -c $> 981.1Smhitch 991.1Smhitchlibboot.a: ${OBJS} 1001.1Smhitch ${AR} r $@ $> && ${RANLIB} $@ 1011.1Smhitch 1021.1Smhitch.PHONY: vers.c 1031.1Smhitchvers.c: ${.CURDIR}/../boot/version 1041.8Slukem ${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga" 1051.1Smhitch 1061.11Stsutsui.if !make(obj) && !make(clean) && !make(cleandir) 1071.11Stsutsui.NOPATH: machine m68k 1081.11Stsutsui.BEGIN: machine m68k 1091.11Stsutsui 1101.1Smhitchmachine: 1111.1Smhitch -rm -f $@ 1121.1Smhitch ln -s ${DIR_TOP}/arch/amiga/include $@ 1131.1Smhitch 1141.1Smhitchm68k: 1151.1Smhitch -rm -f $@ 1161.1Smhitch ln -s ${DIR_TOP}/arch/m68k/include $@ 1171.11Stsutsui.endif 1181.1Smhitch 1191.1Smhitch# make sure these are built: 1201.1Smhitch 1211.1Smhitch${COBJS}: ${TXLT} 1221.1Smhitch${FILES}: ${RELOC2BB} 1231.2Saymeric 1241.2Saymeric.include "${.CURDIR}/../Makefile.booters" 125