1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-29 11:24:36 +03:00
mold/Makefile

42 lines
1.1 KiB
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-10-10 06:47:12 +03:00
LLVM_LIBS=$(wildcard llvm-project/build/lib/libLLVM*.a)
2020-09-29 09:05:29 +03:00
2020-10-09 14:47:45 +03:00
CURRENT_DIR=$(shell pwd)
TBB_LIBDIR=$(wildcard $(CURRENT_DIR)/oneTBB/build/linux_intel64_*_release/)
2020-10-10 12:48:38 +03:00
CPPFLAGS=-g $(shell $(LLVM_CONFIG) --cxxflags) -IoneTBB/include -pthread -O2
2020-10-09 14:47:45 +03:00
LDFLAGS=$(shell $(LLVM_CONFIG) --ldflags) -L$(TBB_LIBDIR) -Wl,-rpath=$(TBB_LIBDIR)
2020-10-10 06:47:12 +03:00
LIBS=-pthread -ltbb -lcurses -Wl,--start-group $(LLVM_LIBS) -Wl,--end-group
2020-10-20 09:33:40 +03:00
OBJS=main.o writer.o input_files.o input_chunks.o output_chunks.o output_file.o
2020-10-02 07:28:26 +03:00
2020-10-20 08:54:35 +03:00
mold: $(OBJS)
2020-10-02 07:28:26 +03:00
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
2020-10-20 08:54:35 +03:00
$(OBJS): mold.h Makefile
2020-10-08 11:01:54 +03:00
2020-10-02 07:28:26 +03:00
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
2020-10-20 08:54:35 +03:00
test: mold
2020-09-29 09:05:29 +03:00
./llvm-project/build/bin/llvm-lit test
clean:
2020-10-20 08:54:35 +03:00
rm -f *.o *~ mold options.inc
2020-09-29 09:05:29 +03:00
.PHONY: llvm intel_tbb test clean