de1fb22150d4fe1a757f181c069e160f0341e024
[dragonfly.git] / sys / boot / dloader / Makefile
1 # The DragonFly Loader
2 #
3 #
4 .if exists(../${MACHINE_PLATFORM}/Makefile.inc)
5 .include "../${MACHINE_PLATFORM}/Makefile.inc"
6 .endif
7
8 .PATH: ${.CURDIR}/${MACHINE_ARCH}
9 SRCS=   subs.c config.c cmds.c
10
11 CFLAGS+=        -ffreestanding
12 .if HAVE_PNP
13 CFLAGS+=        -DHAVE_PNP
14 .endif
15 .ifmake testmain
16 CFLAGS+=        -DTESTMAIN -D_TESTMAIN
17 SRCS+=          testmain.c
18 PROG=           testmain
19 OBJS+=          rel_open.o
20
21 rel_open.o: ../common/rel_open.c
22
23 .include <bsd.prog.mk>
24 .else
25 OBJS+=          stack_protector.o
26 LIB=            dloader
27 INTERNALLIB=    yes
28
29 stack_protector.o: ../../libkern/stack_protector.c
30
31 .include <bsd.lib.mk>
32 .endif
33
34 .if defined(REALLY_X86_64)
35 CFLAGS+=        -m32 -I.
36 .endif
37
38 CFLAGS+=        -I${.CURDIR}
39 CFLAGS+=        -I${.CURDIR}/${MACHINE_ARCH}
40 CFLAGS+=        -I${.CURDIR}/../common
41
42 .if defined(REALLY_X86_64)
43 ${SRCS:M*.c:R:S/$/.o/g}: machine
44
45 beforedepend ${OBJS}: machine
46
47 machine:
48         ${LN} -sf ${.CURDIR}/../../i386/include machine
49
50 CLEANFILES+=    machine
51 .endif