Makefile revision 1.1
1NOPROG=	installboot
2MAN=installboot.8
3
4SUBDIR=aout2bb txlt
5
6TXLT=txlt/txlt
7
8OBJS = configure.o main.o
9OBJS += console.o xd.o
10
11# libsa library replacements:
12OBJS += alloc.o printf.o twiddle.o
13
14# libkern replacements:
15OBJS += bcopy.o bzero.o ashrdi3.o muldi3.o
16
17# machine language startup code:
18OBJS += startit.o
19
20SRCS = installboot.sh configure.c main.c console.c xd.c 
21SRCS+= twiddle.c
22SRCS+= bbstart.s libstubs.s alloc.s printf.s startit.s
23SRCS+= bcopy.s bzero.c ashrdi3.s muldi3.s
24
25CLEANFILES = $(OBJS) $(BOOTBLOCKS) x.out xxstart.s f.out fdstart.s
26
27S=	${.CURDIR}/../../../..
28INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
29COPTIM=	-O2 -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 -Wa,-m68030
30CFLAGS = ${COPTIM} ${INCPATH} ${DEFS}
31COPTS += -Wall -Wstrict-prototypes
32
33BOOTBLOCKS=xxboot # XXX  fdboot is too large at the moment.
34
35.s.o: ; $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $*.o -c $*.s
36
37#libs:
38
39.include "${.CURDIR}/libsa/Makefile.inc"
40LIBSA=  ${SA_LIB}
41
42# libstubs should really be a library, but we don't care for now.
43LIBS=	${LIBSA} ${LIBKERN} libstubs.o
44
45all: $(BOOTBLOCKS) installboot
46
47$(OBJS): txlt
48
49xxstart.s: bbstart.s
50	cpp bbstart.s > $@
51	
52fdstart.s: bbstart.s
53	cpp -DAUTOLOAD=8192 bbstart.s > $@
54
55x.out: xxstart.o $(OBJS) $(LIBS)
56	$(LD) $(LDFLAGS) -r -dc -e _start -o x.out xxstart.o $(OBJS) $(LIBS)
57	size x.out
58
59f.out: fdstart.o $(OBJS) $(LIBS)
60	$(LD) $(LDFLAGS) -r -dc -e _start -o f.out fdstart.o $(OBJS) $(LIBS)
61	size f.out
62
63
64$(BOOTBLOCKS): aout2bb
65
66xxboot: x.out
67	rm -f $@
68	aout2bb/aout2bb x.out $@ || nm -u x.out
69
70fdboot: f.out
71	rm -f $@
72	aout2bb/aout2bb -F f.out $@ || nm -u f.out
73
74clean::
75	rm -f $(OBJS) fdstart.[os] xxstart.[os] f.out x.out installboot
76
77install: all maninstall
78	install -o $(BINOWN) -g $(BINGRP) $(BOOTBLOCKS) /usr/mdec
79	install -o $(BINOWN) -g $(BINGRP) installboot /usr/sbin
80
81ci:
82	ci -l $(SRCS) Makefile
83
84tar:
85	(cd ..; tar \
86		--exclude '*.o' --exclude RCS --exclude .depend \
87		--exclude '*.out' --exclude fdstart.s --exclude xxstart.s \
88		--exclude aout2bb/aout2bb --exclude libsa.a \
89		-czvf boot.tar.gz boot)
90
91test: xxtest fdtest
92
93xxtest: xxboot
94	dd if=$? of=/dev/rsd1e bs=8192 count=1
95
96fdtest: fdboot
97	dd if=$? of=/dev/rfd0a bs=8192 count=1
98
99.include <bsd.prog.mk>
100.include "Makefile.txlt"
101