Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (79 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
91 lines (79 loc) · 1.57 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Copyright (C) 2025 Sylas Hollander.
# PURPOSE: Makefile for Apple TV bare-metal programs
# SPDX-License-Identifier: MIT
#
.NOTPARALLEL: libSystem.dylib ASD
# Check what OS we're running. Should work on Linux and macOS.
OSTYPE = $(shell uname)
# Target defs for Linux cross compiler.
TARGET = i386-apple-darwin8
# Definitions for compiler
ifeq ($(OSTYPE),Linux)
CC := clang
else
CC := /opt/homebrew/opt/llvm/bin/clang
endif
NASM := nasm
INCLUDES := -Iinclude -Ignu-efi/inc
CFLAGS := -Wall \
-Wextra \
-Werror \
-pedantic \
-std=c11 \
-fno-stack-protector \
-Wno-incompatible-library-redeclaration \
-nostdlib \
-fno-builtin \
-O0 \
-std=gnu11 \
--target=$(TARGET) \
$(INCLUDES) \
-fshort-wchar \
-mno-red-zone \
-DEFI_DEBUG \
OBJS_GNUEFI_LIB := boxdraw.o \
cmdline.o \
console.o \
crc.o \
data.o \
debug.o \
dpath.o \
error.o \
event.o \
exit.o \
guid.o \
hand.o \
hw.o \
init.o \
lock.o \
misc.o \
pause.o \
print.o \
smbios.o \
sread.o \
str.o \
runtime/efirtlib.o \
runtime/rtdata.o \
runtime/rtlock.o \
runtime/rtstr.o \
runtime/vm.o \
ia32/initplat.o \
ia32/math.o
OBJS := main.o \
baselibc_string.o \
memory.o \
runtime_override.o \
pecoff.o \
longjmp.o \
exit-asm.o \
$(addprefix gnu-efi/lib/, $(OBJS_GNUEFI_LIB))
%.o: %.asm
$(NASM) -fmacho32 $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
ASD: $(OBJS)
$(CC) $(CFLAGS) -Wl,-bundle -Wl,-e,_main $^ -o $@
all: ASD
clean:
rm -f $(OBJS) ASD