1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-21 01:47:11 +03:00
mold/Makefile

36 lines
815 B
Makefile
Raw Normal View History

2020-10-04 12:00:33 +03:00
CC=clang
CXX=clang++
2020-10-02 07:28:26 +03:00
LLVM_CONFIG=llvm-project/build/bin/llvm-config
LLVM_TBLGEN=llvm-project/build/bin/llvm-tblgen
2020-09-29 09:05:29 +03:00
2020-10-02 10:47:51 +03:00
CPPFLAGS=-g $(shell $(LLVM_CONFIG) --cxxflags) -pthread
2020-10-02 07:28:26 +03:00
LDFLAGS=$(shell $(LLVM_CONFIG) --ldflags)
2020-10-02 10:47:51 +03:00
LIBS=-pthread -lLLVMSupport -lLLVMObject -lLLVMOption -lcurses
2020-10-02 07:28:26 +03:00
OBJS=main.o writer.o
catld: $(OBJS)
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
main.cc: options.inc
options.inc: options.td
$(LLVM_TBLGEN) -I=llvm-project/llvm/include --gen-opt-parser-defs -o $@ $^
2020-09-29 09:05:29 +03:00
submodules: llvm intel_tbb
llvm:
mkdir -p llvm-project/build
(cd llvm-project/build; cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../llvm)
ninja -C llvm-project/build
intel_tbb:
$(MAKE) -C oneTBB
test: catld
./llvm-project/build/bin/llvm-lit test
clean:
2020-10-02 07:28:26 +03:00
rm -f *.o *~ catld options.inc
2020-09-29 09:05:29 +03:00
.PHONY: llvm intel_tbb test clean