1 # $NetBSD: Makefile,v 1.10 1997/05/19 21:19:22 is Exp $ 2 3 ### what we need: 4 5 DIR_TOP= ${.CURDIR}/../../../../.. 6 DIR_SA = ${DIR_TOP}/lib/libsa 7 DIR_KERN= ${DIR_TOP}/lib/libkern 8 DIR_KERN_MD= ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH) 9 10 .PATH: $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) 11 12 # prefer our assembler versions over assembler, and assembler over C: 13 14 .SUFFIXES: 15 .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh 16 17 BOOTBLOCKS= xxboot fdboot 18 19 COBJS = configure.o main.o console.o xd.o twiddle.o bzero.o gets.o 20 COBJS+= lseek.o open.o read.o close.o dev.o 21 COBJS+= ufs.o 22 23 SOBJS = alloc.o ashrdi3.o bcopy.o muldi3.o printf.o startit.o 24 SOBJS += strlen.o strcmp.o 25 SOBJS += libstubs.o 26 27 OBJS= $(SOBJS) $(COBJS) 28 29 DEFS = -DSTANDALONE -DINSECURE 30 31 ### main target: ### 32 33 all: ${BOOTBLOCKS} 34 35 ### special rules for bootblocks ### 36 37 INCPATH = -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../aout2bb 38 39 AFLAGS += -m68030 -l 40 CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH} 41 42 COPTIM= -O2 -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 -Wa,-m68030 43 CFLAGS = ${COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes 44 45 .c.o: 46 $(CC) $(CFLAGS) -S $< -o $*.s 47 $(TXLT) < $*.s | $(AS) $(AFLAGS) -o $*.o 48 rm $*.s 49 50 .s.o: ; $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $@ -c $< 51 52 .S.o: ; $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $@ -c $< 53 54 CLEANFILES += xxboot fdboot x.out f.out xxstart.o fdstart.o libboot.a 55 56 xxboot: x.out 57 $(AOUT2BB) x.out $@ || nm -u x.out 58 59 fdboot: f.out 60 $(AOUT2BB) f.out $@ || nm -u f.out 61 62 x.out: xxstart.o libboot.a 63 $(LD) $(LDFLAGS) -r -dc -e _start -o $@ $> 64 size $@ 65 nm -u $@ 66 67 f.out: fdstart.o libboot.a 68 $(LD) $(LDFLAGS) -r -dc -e _start -o $@ $> 69 size $@ 70 nm -u $@ 71 72 xxstart.o: ${.CURDIR}/bbstart.s 73 $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp \ 74 -o $@ -c $> 75 76 fdstart.o: ${.CURDIR}/bbstart.s 77 $(CC) -DAUTOLOAD=8192 $(CAFLAGS) $(COPTS) -x assembler-with-cpp \ 78 -o $@ -c $> 79 80 libboot.a: $(OBJS) 81 $(AR) r $@ $> && $(RANLIB) $@ 82 83 ### install what we need: ### 84 85 install: all 86 install -o $(BINOWN) -g $(BINGRP) $(BOOTBLOCKS) ${DESTDIR}/usr/mdec 87 88 .include <bsd.prog.mk> 89 90 # make sure these are built: 91 92 ${COBJS}: ${TXLT} 93 ${BOOTBLOCKS}: ${AOUT2BB} 94 95