Merge pull request #1109 from Kelimion/makefile

Fix `Makefile`.
This commit is contained in:
Jeroen van Rijn
2021-08-28 22:41:06 +02:00
committed by GitHub
+21 -24
View File
@@ -8,31 +8,31 @@ CC=clang
OS=$(shell uname) OS=$(shell uname)
ifeq ($(OS), Darwin) ifeq ($(OS), Darwin)
LLVM_CONFIG=llvm-config LLVM_CONFIG=llvm-config
ifneq ($(shell llvm-config --version | grep '^11\.'),) ifneq ($(shell llvm-config --version | grep '^11\.'),)
LLVM_CONFIG=llvm-config LLVM_CONFIG=llvm-config
else else
$(error "Requirement: llvm-config must be version 11") $(error "Requirement: llvm-config must be version 11")
endif endif
LDFLAGS:=$(LDFLAGS) -liconv LDFLAGS:=$(LDFLAGS) -liconv
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags) CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
LDFLAGS:=$(LDFLAGS) -lLLVM-C LDFLAGS:=$(LDFLAGS) -lLLVM-C
endif endif
ifeq ($(OS), Linux) ifeq ($(OS), Linux)
LLVM_CONFIG=llvm-config-11 LLVM_CONFIG=llvm-config-11
ifneq ($(shell which llvm-config-11 2>/dev/null),) ifneq ($(shell which llvm-config-11 2>/dev/null),)
LLVM_CONFIG=llvm-config-11 LLVM_CONFIG=llvm-config-11
else else
ifneq ($(shell llvm-config --version | grep '^11\.'),) ifneq ($(shell llvm-config --version | grep '^11\.'),)
LLVM_CONFIG=llvm-config LLVM_CONFIG=llvm-config
else else
$(error "Requirement: llvm-config must be version 11") $(error "Requirement: llvm-config must be version 11")
endif endif
endif endif
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags) CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs) LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs)
endif endif
all: debug demo all: debug demo
@@ -51,6 +51,3 @@ release_native:
nightly: nightly:
$(CC) src/main.cpp src/libtommath.cpp $(DISABLED_WARNINGS) $(CFLAGS) -DNIGHTLY -O3 $(LDFLAGS) -o odin $(CC) src/main.cpp src/libtommath.cpp $(DISABLED_WARNINGS) $(CFLAGS) -DNIGHTLY -O3 $(LDFLAGS) -o odin