mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-15 11:26:19 +00:00
Use clang when possible for tools (#990)
* Use clang when possible for tools * Add LLD ?= 0
This commit is contained in:
parent
bf0f26db9b
commit
916efa0f7d
2 changed files with 17 additions and 3 deletions
|
@ -1,7 +1,21 @@
|
||||||
CC := gcc
|
|
||||||
CFLAGS := -Wall -Wextra -pedantic -std=c99 -g -O2
|
CFLAGS := -Wall -Wextra -pedantic -std=c99 -g -O2
|
||||||
PROGRAMS := yaz0 makeromfs elf2rom mkldscript vtxdis
|
PROGRAMS := yaz0 makeromfs elf2rom mkldscript vtxdis
|
||||||
ZAPD := ZAPD/ZAPD.out
|
|
||||||
|
ifeq ($(shell command -v clang >/dev/null 2>&1; echo $$?),0)
|
||||||
|
CC := clang
|
||||||
|
else
|
||||||
|
CC := gcc
|
||||||
|
endif
|
||||||
|
|
||||||
|
LLD ?= 0
|
||||||
|
|
||||||
|
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
|
||||||
|
LLD := 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(LLD),0)
|
||||||
|
CFLAGS += -fuse-ld=lld
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(PROGRAMS)
|
all: $(PROGRAMS)
|
||||||
cd ZAPD && $(MAKE)
|
cd ZAPD && $(MAKE)
|
||||||
|
|
|
@ -254,4 +254,4 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue