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

42 lines
1.2 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-26 04:57:46 +03:00
CPPFLAGS=-g $(shell $(LLVM_CONFIG) --cxxflags) -IoneTBB/include -pthread -std=c++17
2020-10-22 16:59:00 +03:00
LDFLAGS=$(shell $(LLVM_CONFIG) --ldflags) -L$(TBB_LIBDIR) -Wl,-rpath=$(TBB_LIBDIR) -fuse-ld=lld
2020-10-10 06:47:12 +03:00
LIBS=-pthread -ltbb -lcurses -Wl,--start-group $(LLVM_LIBS) -Wl,--end-group
2020-10-25 03:26:51 +03:00
OBJS=main.o writer.o input_files.o input_sections.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-23 06:09:27 +03:00
@$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
2020-10-02 07:28:26 +03:00
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
2020-10-24 09:59:38 +03:00
(cd llvm-project/build; cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='lld;clang' -DLLVM_ENABLE_LLD=1 ../llvm)
2020-09-29 09:05:29 +03:00
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