Makefile revision 1.3
11.3Smhitch#	$NetBSD: Makefile,v 1.3 2002/03/26 05:19:39 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.1SmhitchCFLAGS= ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
531.1Smhitch
541.1SmhitchNETBSD_VERS!=	sh ${.CURDIR}/../../../../../conf/osrelease.sh
551.1SmhitchDEFS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
561.1Smhitch
571.1Smhitch.c.o:
581.1Smhitch	${CC} ${CFLAGS} -S $< -o $*.s
591.1Smhitch	${TXLT} < $*.s | ${AS} ${AFLAGS} -o $*.o
601.1Smhitch	rm $*.s
611.1Smhitch
621.1Smhitch.s.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
631.1Smhitch
641.1Smhitch.S.o: ; ${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp -o $@ -c $<
651.1Smhitch
661.1Smhitchbootxx_ffs: x.out
671.1Smhitch	${RELOC2BB} x.out $@ || ${NM} -u x.out
681.1Smhitch
691.1Smhitchbootxx_fd: f.out
701.1Smhitch	${RELOC2BB} -F f.out $@ || ${NM} -u f.out
711.1Smhitch
721.1Smhitchx.out: xxstart.o libboot.a
731.1Smhitch	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
741.1Smhitch	${SIZE} $@
751.1Smhitch	${NM} -u $@
761.1Smhitch
771.1Smhitchf.out: fdstart.o libboot.a
781.1Smhitch	${LD} ${LDFLAGS} -r -dc -e _start -o $@ $>
791.1Smhitch	${SIZE} $@
801.1Smhitch	${NM} -u $@
811.1Smhitch
821.1Smhitchxxstart.o: ${.CURDIR}/../boot/bbstart.s
831.1Smhitch	${CC} ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
841.1Smhitch		-o $@ -c $>
851.1Smhitch
861.1Smhitchfdstart.o: ${.CURDIR}/../boot//bbstart.s
871.1Smhitch	${CC} -DAUTOLOAD=8192 ${CAFLAGS} ${COPTS} -x assembler-with-cpp \
881.1Smhitch		-o $@ -c $>
891.1Smhitch
901.1Smhitchlibboot.a: ${OBJS}
911.1Smhitch	${AR} r $@ $> && ${RANLIB} $@
921.1Smhitch
931.1Smhitch.PHONY:	vers.c
941.1Smhitchvers.c:	${.CURDIR}/../boot/version
951.1Smhitch	sh ${DIR_TOP}/conf/newvers_stand.sh -NDM ${.CURDIR}/../boot/version "amiga"
961.1Smhitch
971.1Smhitchmachine:
981.1Smhitch	-rm -f $@
991.1Smhitch	ln -s ${DIR_TOP}/arch/amiga/include $@
1001.1Smhitch
1011.1Smhitchm68k:
1021.1Smhitch	-rm -f $@
1031.1Smhitch	ln -s ${DIR_TOP}/arch/m68k/include $@
1041.1Smhitch
1051.1Smhitch# make sure these are built:
1061.1Smhitch
1071.1Smhitch${COBJS}: ${TXLT}
1081.1Smhitch${FILES}: ${RELOC2BB}
1091.2Saymeric
1101.2Saymeric.include "${.CURDIR}/../Makefile.booters"
111