Makefile revision 123374
1# $FreeBSD: head/sys/boot/ficl/Makefile 123374 2003-12-10 09:10:54Z grehan $
2#
3.if ${MACHINE_ARCH} == "amd64"
4.MAKEFLAGS:  MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
5.endif
6
7.PATH: ${.CURDIR}/${MACHINE_ARCH}
8BASE_SRCS=	dict.c ficl.c fileaccess.c float.c loader.c math64.c \
9		prefix.c search.c stack.c tools.c vm.c words.c
10
11SRCS=		${BASE_SRCS} sysdep.c softcore.c
12CLEANFILES=	softcore.c testmain testmain.o
13CFLAGS+=	-ffreestanding
14.if ${MACHINE_ARCH} == "alpha"
15CFLAGS+=	-mno-fp-regs
16.endif
17.if ${MACHINE_ARCH} == "i386"
18CFLAGS+=	-mpreferred-stack-boundary=2
19.endif
20.if ${MACHINE_ARCH} == "powerpc"
21CFLAGS+=	-msoft-float
22.endif
23.if ${MACHINE} == "pc98"
24CFLAGS+=	-DPC98
25.endif
26.if HAVE_PNP
27CFLAGS+=	-DHAVE_PNP
28.endif
29.ifmake testmain
30CFLAGS+=	-DTESTMAIN -D_TESTMAIN
31SRCS+=		testmain.c
32PROG=		testmain
33.include <bsd.prog.mk>
34.else
35LIB=		ficl
36INTERNALLIB=	yes
37.include <bsd.lib.mk>
38.endif
39
40# Standard softwords
41.PATH: ${.CURDIR}/softwords
42SOFTWORDS=	softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
43		ifbrack.fr
44# Optional OO extension softwords
45#SOFTWORDS+=	oo.fr classes.fr
46
47.if defined(REALLY_AMD64)
48CFLAGS+=	-m32 -I.
49.endif
50
51CFLAGS+=	-I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}/../common
52
53softcore.c: ${SOFTWORDS} softcore.awk
54	(cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
55	    | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
56
57.if defined(REALLY_AMD64)
58${SRCS:M*.c:R:S/$/.o/g}: machine
59
60beforedepend ${OBJS}: machine
61
62machine:
63	ln -sf ${.CURDIR}/../../i386/include machine
64
65CLEANFILES+=	machine
66.endif
67