mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
Makefile: clang support
Signed-off-by: Ferdinand Bachmann <theferdi265@gmail.com>
This commit is contained in:
parent
6ecf5d9fb5
commit
c6da21ceff
1 changed files with 10 additions and 2 deletions
12
Makefile
12
Makefile
|
@ -2,9 +2,10 @@ ARCH := aarch64-linux-gnu-
|
|||
|
||||
CFLAGS := -O2 -Wall -Wundef -Werror=strict-prototypes -fno-common -fno-PIE \
|
||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||
-ffreestanding -mabi=lp64 -fpic -ffunction-sections -fdata-sections
|
||||
-ffreestanding -fpic -ffunction-sections -fdata-sections \
|
||||
-fno-stack-protector -mgeneral-regs-only
|
||||
|
||||
LDFLAGS := -T m1n1.ld -EL -maarch64elf --no-undefined -X -shared -Bsymbolic \
|
||||
LDFLAGS := -T m1n1.ld -EL -maarch64elf --no-undefined -X -Bsymbolic \
|
||||
-z notext --no-apply-dynamic-relocs --orphan-handling=warn --strip-debug \
|
||||
-z nocopyreloc --gc-sections -pie
|
||||
|
||||
|
@ -18,10 +19,17 @@ TARGET := m1n1.macho
|
|||
|
||||
DEPDIR := build/.deps
|
||||
|
||||
ifeq ($(USE_CLANG),1)
|
||||
CC := clang --target=$(ARCH)
|
||||
AS := clang --target=$(ARCH)
|
||||
LD := ld.lld
|
||||
OBJCOPY := llvm-objcopy
|
||||
else
|
||||
CC := $(ARCH)gcc
|
||||
AS := $(ARCH)gcc
|
||||
LD := $(ARCH)ld
|
||||
OBJCOPY := $(ARCH)objcopy
|
||||
endif
|
||||
|
||||
.PHONY: all clean format
|
||||
all: build/$(TARGET)
|
||||
|
|
Loading…
Reference in a new issue