Skip to content
This repository has been archived by the owner on Jun 1, 2020. It is now read-only.

Osx makefile #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# This code is in the public domain
#-------------------------------------------------------------------------------

UNAME := $(shell uname -s)

# The following variables will likely need to be customized, depending on where
# and how you built LLVM & Clang. They can be overridden by setting them on the
# make command line: "make VARNAME=VALUE", etc.
Expand Down Expand Up @@ -55,7 +57,7 @@ LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --ldflags --libs --system-libs`
# libs to be linked more than once because it uses globals for configuration
# and plugin registration, and these trample over each other.
LLVM_LDFLAGS_NOLIBS := `$(LLVM_BIN_PATH)/llvm-config --ldflags`
PLUGIN_LDFLAGS := -shared
PLUGIN_LDFLAGS := -shared -Wl,-undefined,dynamic_lookup

CLANG_INCLUDES := \
-I$(LLVM_SRC_PATH)/tools/clang/include \
Expand All @@ -67,8 +69,15 @@ CLANG_INCLUDES := \
# because there are circular dependencies that make the correct order difficult
# to specify and maintain. The linker group options make the linking somewhat
# slower, but IMHO they're still perfectly fine for tools that link with Clang.
CLANG_LIBS := \
-Wl,--start-group \

# Note: if using Darwin, may need to get rid of -lclangToolingCore.

ifneq ($(UNAME),Darwin)
CLANG_LIBS += \
-Wl,--start-group
endif

CLANG_LIBS += \
-lclangAST \
-lclangAnalysis \
-lclangBasic \
Expand All @@ -88,8 +97,12 @@ CLANG_LIBS := \
-lclangStaticAnalyzerCore \
-lclangSerialization \
-lclangToolingCore \
-lclangTooling \
-Wl,--end-group
-lclangTooling

ifneq ($(UNAME),Darwin)
CLANG_LIBS += \
-Wl,--end-group
endif

# Internal paths in this project: where to find sources, and where to put
# build artifacts.
Expand Down