aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSébastien Marie <semarie@online.fr>2022-02-25 13:02:12 +0000
committerSébastien Marie <semarie@online.fr>2022-02-25 13:02:12 +0000
commit83523badb7cebd524170fdacffc4d49c217e2b61 (patch)
treea0da42f09b4b5743db9cf4bacb2817f85e490815 /Makefile
parent0a9099440370c902a6d3a08493f6c02363874be5 (diff)
pass -ldl only on Darwin and Linux
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 99c71ccd9..72c1c7b95 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
GIT_SHA=$(shell git rev-parse --short HEAD)
DISABLED_WARNINGS=-Wno-switch -Wno-macro-redefined -Wno-unused-value
-LDFLAGS=-pthread -ldl -lm -lstdc++
+LDFLAGS=-pthread -lm -lstdc++
CFLAGS=-std=c++14 -DGIT_SHA=\"$(GIT_SHA)\"
CFLAGS:=$(CFLAGS) -DODIN_VERSION_RAW=\"dev-$(shell date +"%Y-%m")\"
CC=clang
@@ -8,7 +8,7 @@ CC=clang
OS=$(shell uname)
ifeq ($(OS), Darwin)
-
+
ARCH=$(shell uname -m)
LLVM_CONFIG=
@@ -37,7 +37,7 @@ ifeq ($(OS), Darwin)
endif
endif
- LDFLAGS:=$(LDFLAGS) -liconv
+ LDFLAGS:=$(LDFLAGS) -liconv -ldl
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
LDFLAGS:=$(LDFLAGS) -lLLVM-C
endif
@@ -55,14 +55,16 @@ ifeq ($(OS), Linux)
endif
endif
+ LDFLAGS:=$(LDFLAGS) -ldl
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs)
endif
ifeq ($(OS), OpenBSD)
LLVM_CONFIG=/usr/local/bin/llvm-config
+ LDFLAGS:=$(LDFLAGS) -liconv
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
- LDFLAGS:=$(LDFLAGS) -liconv $(shell $(LLVM_CONFIG) --libs core native --system-libs)
+ LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs)
endif
all: debug demo