summaryrefslogtreecommitdiff
path: root/sys/arch/amiga/stand/boot/Makefile
blob: f101ec86badd3d58c50651c3053dc75816df13e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#	$OpenBSD: Makefile,v 1.6 2000/02/12 15:29:06 espie Exp $

NOPROG=	installboot
MAN=installboot.8
MANSUBDIR=/amiga

.if ${MACHINE}== "amiga"

SUBDIR=aout2bb txlt libsa

AOUT2BB!=cd $(.CURDIR)/aout2bb; \
	printf "xxx:\n\techo \$${.OBJDIR}/aout2bb\n" | \
	${MAKE} -r -s -f - xxx | grep aout2bb

TXLT!=	cd $(.CURDIR)/txlt; \
	printf "xxx:\n\techo \$${.OBJDIR}/txlt\n" | \
	${MAKE} -r -s -f - xxx | grep txlt

OBJS=	configure.o main.o
OBJS+=	console.o xd.o

# libsa library replacements:
OBJS+=	alloc.o printf.o twiddle.o

# libkern replacements:
OBJS+=	bcopy.o ashrdi3.o muldi3.o

# machine language startup code:
OBJS+=	startit.o

SRCS=	installboot.sh configure.c main.c console.c xd.c twiddle.c
SRCS+=	bbstart.s libstubs.s alloc.s printf.s startit.s
SRCS+=	bcopy.s ashrdi3.s muldi3.s

CLEANFILES=	$(OBJS) $(BOOTBLOCKS) x.out xxstart.s f.out fdstart.s

S=		${.CURDIR}/../../../..
INCPATH=	-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
COPTIM=		-O -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 \
		-Wa,-m68030
CFLAGS=		${COPTIM} ${INCPATH} ${DEFS}
COPTS+=		-Wall -Wstrict-prototypes

BOOTBLOCKS=	xxboot # XXX  fdboot is too large at the moment.

.s.o:
	$(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $*.o -c $<

#libs:

.include "${.CURDIR}/libsa/Makefile.inc"
LIBSA=  ${SA_LIB}

# libstubs should really be a library, but we don't care for now.
LIBS=	${LIBSA} ${LIBKERN} libstubs.o

all: $(BOOTBLOCKS) installboot

$(OBJS): txlt

xxstart.s: bbstart.s
	cpp ${.CURDIR}/bbstart.s > $@
	
fdstart.s: bbstart.s
	cpp -DAUTOLOAD=8192 ${.CURDIR}/bbstart.s > $@

x.out: xxstart.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) -r -dc -e _start -o x.out xxstart.o $(OBJS) $(LIBS)
	size x.out

f.out: fdstart.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) -r -dc -e _start -o f.out fdstart.o $(OBJS) $(LIBS)
	size f.out


$(BOOTBLOCKS): aout2bb

xxboot: x.out
	rm -f $@
	${AOUT2BB} x.out $@ || nm -u x.out

fdboot: f.out
	rm -f $@
	${AOUT2BB} -F f.out $@ || nm -u f.out

clean::
	rm -f $(OBJS) fdstart.[os] xxstart.[os] f.out x.out installboot

install: all maninstall
	install -o $(BINOWN) -g $(BINGRP) $(BOOTBLOCKS) /usr/mdec
	install -o $(BINOWN) -g $(BINGRP) installboot /usr/sbin

ci:
	ci -l $(SRCS) Makefile

tar:
	(cd ..; tar \
		--exclude '*.o' --exclude RCS --exclude .depend \
		--exclude '*.out' --exclude fdstart.s --exclude xxstart.s \
		--exclude aout2bb/aout2bb --exclude libsa.a \
		-czvf boot.tar.gz boot)

test: xxtest fdtest

xxtest: xxboot
	dd if=$? of=/dev/rsd1e bs=8192 count=1

fdtest: fdboot
	dd if=$? of=/dev/rfd0a bs=8192 count=1

.endif

.include <bsd.prog.mk>
.include "Makefile.txlt"