Makefile revision 1.10
1#	$NetBSD: Makefile,v 1.10 1997/05/19 21:19:22 is Exp $
2
3### what we need:
4
5DIR_TOP=	${.CURDIR}/../../../../..
6DIR_SA = 	${DIR_TOP}/lib/libsa
7DIR_KERN=	${DIR_TOP}/lib/libkern
8DIR_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
17BOOTBLOCKS= xxboot fdboot
18
19COBJS = configure.o main.o console.o xd.o twiddle.o bzero.o gets.o
20COBJS+=  lseek.o open.o read.o close.o dev.o
21COBJS+=  ufs.o
22
23SOBJS = alloc.o ashrdi3.o bcopy.o muldi3.o printf.o startit.o
24SOBJS += strlen.o strcmp.o
25SOBJS += libstubs.o 
26
27OBJS=	$(SOBJS) $(COBJS)
28
29DEFS = -DSTANDALONE -DINSECURE
30
31### main target: ###
32
33all: ${BOOTBLOCKS}
34
35### special  rules for bootblocks ###
36
37INCPATH = -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../aout2bb
38
39AFLAGS += -m68030 -l
40CAFLAGS += -Wa,-l -Wa,-m68030 ${INCPATH}
41
42COPTIM= -O2 -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 -Wa,-m68030
43CFLAGS = ${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
54CLEANFILES += xxboot fdboot x.out f.out xxstart.o fdstart.o libboot.a
55
56xxboot: x.out
57	$(AOUT2BB) x.out $@ || nm -u x.out
58
59fdboot: f.out
60	$(AOUT2BB) f.out $@ || nm -u f.out
61
62x.out: xxstart.o libboot.a
63	$(LD) $(LDFLAGS) -r -dc -e _start -o $@ $>
64	size $@
65	nm -u $@
66
67f.out: fdstart.o libboot.a
68	$(LD) $(LDFLAGS) -r -dc -e _start -o $@ $>
69	size $@
70	nm -u $@
71
72xxstart.o: ${.CURDIR}/bbstart.s
73	$(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp \
74		-o $@ -c $>
75
76fdstart.o: ${.CURDIR}/bbstart.s
77	$(CC) -DAUTOLOAD=8192 $(CAFLAGS) $(COPTS) -x assembler-with-cpp \
78		-o $@ -c $>
79
80libboot.a: $(OBJS)
81	$(AR) r $@ $> && $(RANLIB) $@
82
83### install what we need: ###
84
85install: 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