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