fc1e5112f98caacd71909e42681f68f436c5555e
[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 exists(../${MACHINE_PLATFORM}/Makefile.inc)
5 .include "../${MACHINE_PLATFORM}/Makefile.inc"
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 HAVE_PNP
17 CFLAGS+=        -DHAVE_PNP
18 .endif
19 .ifmake testmain
20 CFLAGS+=        -DTESTMAIN -D_TESTMAIN
21 SRCS+=          testmain.c
22 PROG=           testmain
23 OBJS+=          rel_open.o
24
25 rel_open.o: ../common/rel_open.c
26
27 .include <bsd.prog.mk>
28 .else
29 OBJS+=          stack_protector.o
30 LIB=            ficl
31 INTERNALLIB=    yes
32
33 stack_protector.o: ../../libkern/stack_protector.c
34
35 .include <bsd.lib.mk>
36 .endif
37
38 # Standard softwords
39 .PATH: ${.CURDIR}/softwords
40 SOFTWORDS=      softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
41                 ifbrack.fr
42 # Optional OO extension softwords
43 #SOFTWORDS+=    oo.fr classes.fr
44
45 .if defined(REALLY_X86_64)
46 CFLAGS+=        -m32 -I.
47 .endif
48
49 CFLAGS+=        -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -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 defined(REALLY_X86_64)
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