summaryrefslogtreecommitdiffstats
path: root/config.mk
blob: 4b940b582e7f25f2933833a892c542d82750f749 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PROCESSORS_MAX=8
ENABLE_UART = y
ENABLE_PORTIO_UART = y
ENABLE_INITRD = y

DBG_MEM = y

CFLAGS = \
		  -ffreestanding \
		  -mno-sse \
		  -nostdlib \
		  -fno-pie \
		  -fno-pic \
		  -g \
		  -D__$(TARGET_MACHINE)__ \
		  -D__$(TARGET_BOOTLOADER)__ \
		  -DPROCESSORS_MAX=$(PROCESSORS_MAX) \
		  -Iinclude \
		  -I.

LDFLAGS = -nostdlib \
		   -z max-page-size=0x1000 \
		   -T link/$(TARGET_TRIPLET).ld

ifeq "$(TARGET_MACHINE)" "x86_64"
	CFLAGS += -m64 \
			  -mno-red-zone \
			  -mcmodel=kernel \
			  -mfsgsbase
endif

ifeq "$(ENABLE_UART)" "y"
CFLAGS += -DENABLE_UART	
endif
ifeq "$(ENABLE_PORTIO_UART)" "y"
CFLAGS += -DENABLE_PORTIO_UART
endif
ifeq "$(ENABLE_INITRD)" "y"
CFLAGS += -DENABLE_INITRD
endif

ifeq "$(DBG_MEM)" "y"
CFLAGS += -DDBG_MEM
endif