xref: /netbsd/sys/arch/sparc/stand/bootblk/Makefile (revision c4a72b64)
1#	$NetBSD: Makefile,v 1.4 2002/05/28 21:56:54 bjh21 Exp $
2
3CURDIR=	${.CURDIR}
4S=	${CURDIR}/../../../..
5
6#
7# Override normal settings
8#
9
10PROG=	bootblk
11SRCS=		bootblk.fth
12OBJS=
13CLEANFILES=	assym.fth.h assym.fth.h.tmp machine sparc \
14		bootblk bootblk.text bootblk.text.tmp
15
16NOMAN=		# defined
17STRIPFLAG=
18
19# deal with Solaris vs. NetBSD build environments for now ..
20OS!=uname -s
21.if (${OS} == "NetBSD")
22USE_GENASSYM?=	no
23SVR4=
24.else
25USE_GENASSYM?=	yes
26SVR4=-U__SVR4 -U__svr4__ -D__NetBSD__
27.endif
28
29INCLUDES=	-I. -I$S/arch -I$S -nostdinc
30CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_LKM ${SVR4}
31
32#all:: bootblk.text bootblk
33
34#clean::
35#	rm assym.fth.h bootblk.text machine bootblk
36
37sparc:
38	ln -s ${.CURDIR}/../../../sparc/include sparc
39
40machine:
41	ln -s ${.CURDIR}/../../../${MACHINE}/include machine
42
43assym.fth.h: ${.CURDIR}/genassym.sh genfth.cf machine
44	sh ${.CURDIR}/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
45	    <${.CURDIR}/genfth.cf >assym.fth.h.tmp && \
46	    mv -f assym.fth.h.tmp assym.fth.h
47
48bootblk.text: bootblk.fth assym.fth.h
49	awk '/fload/ { print "#include \"" $$2 "\"" }; !/fload/' \
50	    ${.CURDIR}/bootblk.fth | /usr/bin/cpp -P >bootblk.text.tmp &&
51	    mv -f bootblk.text.tmp bootblk.text
52
53bootblk: bootblk.fth assym.fth.h
54	${FGEN} -o bootblk ${.CURDIR}/bootblk.fth
55
56beforedepend:
57	@touch .depend
58
59#
60# The following are if you grab the fakeboot program from the Sun website
61#
62
63fake: bootblk bootblk.text
64	../fakeboot/fakeboot -elf32 <bootblk >/bootblk
65	../fakeboot/fakeboot -elf32 <bootblk.text >/bootblk.text
66
67.include <bsd.prog.mk>
68