]> CyberLeo.Net >> Repos - FreeBSD/releng/10.1.git/blob - sys/boot/ficl/Makefile
Copy stable/10@r272459 to releng/10.1 as part of
[FreeBSD/releng/10.1.git] / sys / boot / ficl / Makefile
1 # $FreeBSD$
2 #
3
4 FICLDIR?=       ${.CURDIR}
5
6 .if defined(FICL32)
7 .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
8 .else
9 .PATH: ${FICLDIR}/${MACHINE_CPUARCH}
10 .endif
11 BASE_SRCS=      dict.c ficl.c fileaccess.c float.c loader.c math64.c \
12                 prefix.c search.c stack.c tools.c vm.c words.c
13
14 SRCS=           ${BASE_SRCS} sysdep.c softcore.c
15 CLEANFILES=     softcore.c testmain testmain.o
16 CFLAGS+=        -ffreestanding
17 .if ${MACHINE_CPUARCH} == "i386" || \
18     (${MACHINE_CPUARCH} == "amd64" && defined(FICL32))
19 CFLAGS+=        -march=i386
20 CFLAGS.gcc+=    -mpreferred-stack-boundary=2
21 .endif
22 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
23 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
24 .endif
25 .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
26 CFLAGS+=        -msoft-float
27 .endif
28 .if ${MACHINE} == "pc98"
29 CFLAGS+=        -Os -DPC98
30 .endif
31 .if HAVE_PNP
32 CFLAGS+=        -DHAVE_PNP
33 .endif
34 .ifmake testmain
35 CFLAGS+=        -DTESTMAIN -D_TESTMAIN
36 SRCS+=          testmain.c
37 PROG=           testmain
38 .include <bsd.prog.mk>
39 .else
40 LIB=            ficl
41 INTERNALLIB=
42 .include <bsd.lib.mk>
43 .endif
44
45 # Standard softwords
46 .PATH: ${FICLDIR}/softwords
47 SOFTWORDS=      softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
48                 ifbrack.fr
49 # Optional OO extension softwords
50 #SOFTWORDS+=    oo.fr classes.fr
51
52 .if ${MACHINE_CPUARCH} == "amd64"
53 .if defined(FICL32)
54 CFLAGS+=        -m32 -I.
55 .else
56 CFLAGS+=        -fPIC
57 .endif
58 .endif
59
60 .if ${MACHINE_ARCH} == "powerpc64"
61 CFLAGS+=        -m32 -mcpu=powerpc -I.
62 .endif
63
64 .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
65 FICL_CPUARCH=   i386
66 .else
67 FICL_CPUARCH=   ${MACHINE_CPUARCH}
68 .endif
69
70 CFLAGS+=        -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \
71                 -I${FICLDIR}/../common
72
73 softcore.c: ${SOFTWORDS} softcore.awk
74         (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \
75             | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
76
77 .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
78 .if !exists(machine)
79 ${SRCS:M*.c:R:S/$/.o/g}: machine
80
81 beforedepend ${OBJS}: machine
82 .endif
83
84 machine:
85         ln -sf ${.CURDIR}/../../i386/include machine
86
87 CLEANFILES+=    machine
88 .endif