sys/boot: Define _STANDALONE while building.
[dragonfly.git] / sys / boot / dloader / Makefile
1 # The DragonFly Loader
2 #
3 #
4
5 SRCS=   subs.c cmds.c
6
7 WORLD_CCOPTLEVEL=       1       # Force -O1, -O2 implodes
8
9 # Disable stack protector
10 CFLAGS+=        -fno-stack-protector
11
12 # For i386, dloader32/Makefile takes care of the extra CFLAGS
13 .if ${MACHINE_ARCH} != "i386"
14 CFLAGS+=        -fPIC -mno-red-zone
15 CFLAGS+=        -ffreestanding
16 CFLAGS+=        -D_STANDALONE
17 .endif
18
19 .if ${MACHINE_ARCH} == "x86_64"
20 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
21 .endif
22
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 OBJS+=          rel_open.o
31
32 rel_open.o: ../common/rel_open.c
33
34 .include <bsd.prog.mk>
35 .else
36 OBJS+=          stack_protector.o
37 LIB?=           dloader
38 INTERNALLIB=    yes
39
40 stack_protector.o: ../../libkern/stack_protector.c
41
42 .include <bsd.lib.mk>
43 .endif
44
45 CFLAGS+=        -I${.CURDIR}
46 CFLAGS+=        -I${.CURDIR}/../common