Document MAKEOBJDIRPREFIX.
[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.9 2005/10/05 15:39:46 dillon 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 OBJS+=          stack_protector.o
14
15 stack_protector.o: ../../libkern/stack_protector.c
16
17 CLEANFILES=     softcore.c testmain testmain.o
18 CFLAGS+=        -ffreestanding
19 .if ${MACHINE_ARCH} == "i386"
20 CFLAGS+=        -mpreferred-stack-boundary=2
21 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2  # Do not use fp regs
22 CFLAGS+=        -mno-sse3                               # in integer code
23 .endif
24 .if HAVE_PNP
25 CFLAGS+=        -DHAVE_PNP
26 .endif
27 .ifmake testmain
28 CFLAGS+=        -DTESTMAIN -D_TESTMAIN
29 SRCS+=          testmain.c
30 PROG=           testmain
31 .include <bsd.prog.mk>
32 .else
33 LIB=            ficl
34 INTERNALLIB=    yes
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_AMD64)
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_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