-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.head
More file actions
71 lines (59 loc) · 1.3 KB
/
Makefile.head
File metadata and controls
71 lines (59 loc) · 1.3 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
OS := $(shell uname)
TOOL_DIR := tools
ifeq ($V, 1)
Q =
S =
else
S ?= -s
Q ?= @
endif
export V Q S
#
# if you want the ram-disk device, define this to be the
# size in blocks.
#
RAMDISK_START ?= 256
RAMDISK_SIZE ?= 2048
%.o: %.c
$(Q)$(CC) $(CFLAGS) -c -o $*.o $<
$(Q)echo "CC " $<
%.o: %.s
$(Q)$(AS) $(AFLAGS) -o $*.o $<
$(Q)echo "AS " $<
%.s: %.c
$(Q)$(CC) $(CFLAGS) -S -o $*.s $<
$(Q)echo "ASC " $<
# Tool for Image building
BUILD = RAMDISK_START=$(RAMDISK_START) $(TOOL_DIR)/build.sh
ifeq ($(OS), Linux)
AS = as
AFLAGS = -g --32
LD = ld
LDFLAGS = -m elf_i386
CC = gcc
CFLAGS = -g -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall
CPP = cpp -nostdinc
AR = ar
STRIP = strip
OBJCOPY = objcopy
endif
ifeq ($(OS), Darwin)
AS = i386-elf-as
AFLAGS = -g --32
LD = i386-elf-ld
LDFLAGS = -m elf_i386
CC = i386-elf-gcc
CFLAGS = -gdwarf-2 -g3 -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall
CPP = i386-elf-cpp -nostdinc
AR = i386-elf-ar
STRIP = i386-elf-strip
OBJCOPY = i386-elf-objcopy
endif
ifeq (${VGA}, 1)
CFLAGS += -DCONFIG_VGA
CPP += -DCONFIG_VGA
endif
ifeq (${TSS}, 1)
CFLAGS += -DCONFIG_SWITCH_TSS
CPP += -DCONFIG_SWITCH_TSS
endif