ficl: unbreak testmain build
[dragonfly.git] / sys / boot / ficl / Makefile
1 # $FreeBSD: src/sys/boot/ficl/Makefile,v 1.35 2003/06/30 19:08:49 ru Exp $
2 # $DragonFly: src/sys/boot/ficl/Makefile,v 1.10 2008/03/30 18:11:58 swildner Exp $
3 #
4 .if ${MACHINE_ARCH} == "amd64"
5 .MAKEFLAGS:  MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
6 .endif
7
8 .PATH: ${.CURDIR}/${MACHINE_ARCH}
9 BASE_SRCS=      dict.c ficl.c fileaccess.c float.c loader.c math64.c \
10                 prefix.c search.c stack.c tools.c vm.c words.c
11
12 SRCS=           ${BASE_SRCS} sysdep.c softcore.c
13
14 CLEANFILES=     softcore.c testmain testmain.o
15 CFLAGS+=        -ffreestanding
16 .if ${MACHINE_ARCH} == "i386"
17 CFLAGS+=        -mpreferred-stack-boundary=2
18 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2  # Do not use fp regs
19 CFLAGS+=        -mno-sse3                               # in integer code
20 .endif
21 .if HAVE_PNP
22 CFLAGS+=        -DHAVE_PNP
23 .endif
24 .ifmake testmain
25 CFLAGS+=        -DTESTMAIN -D_TESTMAIN
26 SRCS+=          testmain.c
27 PROG=           testmain
28 OBJS+=          rel_open.o
29
30 rel_open.o: ../common/rel_open.c
31
32 .include <bsd.prog.mk>
33 .else
34 OBJS+=          stack_protector.o
35 LIB=            ficl
36 INTERNALLIB=    yes
37
38 stack_protector.o: ../../libkern/stack_protector.c
39
40 .include <bsd.lib.mk>
41 .endif
42
43 # Standard softwords
44 .PATH: ${.CURDIR}/softwords
45 SOFTWORDS=      softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
46                 ifbrack.fr
47 # Optional OO extension softwords
48 #SOFTWORDS+=    oo.fr classes.fr
49
50 .if defined(REALLY_AMD64)
51 CFLAGS+=        -m32 -I.
52 .endif
53
54 CFLAGS+=        -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}/../common
55
56 softcore.c: ${SOFTWORDS} softcore.awk
57         (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
58             | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
59
60 .if defined(REALLY_AMD64)
61 ${SRCS:M*.c:R:S/$/.o/g}: machine
62
63 beforedepend ${OBJS}: machine
64
65 machine:
66         ${LN} -sf ${.CURDIR}/../../i386/include machine
67
68 CLEANFILES+=    machine
69 .endif