forked from yuan-xy/Linux-0.11
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.header
executable file
·100 lines (94 loc) · 2.15 KB
/
Makefile.header
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname)
endif
ifeq ($(detected_OS), Linux)
ifdef WSL_DISTRO_NAME
detected_OS := WSL
endif
OS_Name := $(shell uname -o)
ifeq ($(OS_Name), Android)
detected_OS := Android
endif
endif
ifeq ($(detected_OS), Linux)
BOCHS=bochs
BXRC=x.bxrc
QEMU=qemu-system-i386
AS = as --32
LD = ld
LDFLAGS = -m elf_i386
CC = gcc
CFLAGS = -g -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce -fgnu89-inline -Wall
CPP = cpp -nostdinc
AR = ar
STRIP = strip
OBJCOPY = objcopy
NM = nm
GDB = gdb
endif
ifeq ($(detected_OS), WSL)
BOCHS=bochsdbg.exe
BXRC=win32.bxrc
QEMU=qemu-system-i386.exe
AS = as --32
LD = ld
LDFLAGS = -m elf_i386
CC = gcc
CFLAGS = -g -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce -fgnu89-inline -Wall
CPP = cpp -nostdinc
AR = ar
STRIP = strip
OBJCOPY = objcopy
NM = nm
GDB = gdb
endif
ifeq ($(detected_OS), Windows)
BOCHS=bochsdbg
BXRC=win32.bxrc
QEMU=qemu-system-i386
AS = i686-elf-as --32
LD = i686-elf-ld
LDFLAGS = -m elf_i386
CC = i686-elf-gcc
CFLAGS = -gdwarf-2 -g3 -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall
CPP = i686-elf-cpp -nostdinc
AR = i686-elf-ar
STRIP = i686-elf-strip
OBJCOPY = i686-elf-objcopy
NM = i686-elf-nm
GDB = i686-elf-gdb
endif
ifeq ($(detected_OS), Darwin)
BOCHS=bochs
BXRC=sdl2.bxrc
QEMU=qemu-system-i386
AS = i386-elf-as --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
NM = i386-elf-nm
GDB = i386-elf-gdb
endif
ifeq ($(detected_OS), Android)
BOCHS=bochs
BXRC=x.bxrc
QEMU=qemu-system-i386
AS = clang --target=i386-pc-none-elf -c
LD = ld.lld
LDFLAGS = -m elf_i386
CC = clang --target=i386-pc-none-elf
CFLAGS = -gdwarf-2 -g3 -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer
CPP = clang-cpp -nostdinc
AR = llvm-ar
STRIP = llvm-strip
OBJCOPY = llvm-objcopy
NM = llvm-nm
GDB = gdb
endif