2020-10-04 12:00:33 +03:00
|
|
|
CC=clang
|
|
|
|
CXX=clang++
|
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-12-11 10:52:19 +03:00
|
|
|
CPPFLAGS=-g -IoneTBB/include -pthread -std=c++20 -Wno-deprecated-volatile -O2
|
|
|
|
LDFLAGS=-L$(TBB_LIBDIR) -Wl,-rpath=$(TBB_LIBDIR) -fuse-ld=lld
|
2020-12-12 08:28:13 +03:00
|
|
|
LIBS=-pthread -ltbb -lcurses
|
2020-11-19 03:24:10 +03:00
|
|
|
OBJS=main.o object_file.o input_sections.o output_chunks.o mapfile.o perf.o \
|
2020-12-12 06:48:00 +03:00
|
|
|
linker_script.o
|
2020-10-02 07:28:26 +03:00
|
|
|
|
2020-10-20 08:54:35 +03:00
|
|
|
mold: $(OBJS)
|
2020-11-30 11:06:52 +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-12-11 16:17:21 +03:00
|
|
|
submodules: intel_tbb
|
2020-09-29 09:05:29 +03:00
|
|
|
|
|
|
|
intel_tbb:
|
|
|
|
$(MAKE) -C oneTBB
|
|
|
|
|
2020-10-20 08:54:35 +03:00
|
|
|
test: mold
|
2020-12-11 13:34:05 +03:00
|
|
|
(cd test; for i in *.sh; do ./$$i; done)
|
2020-09-29 09:05:29 +03:00
|
|
|
|
|
|
|
clean:
|
2020-12-11 06:46:03 +03:00
|
|
|
rm -f *.o *~ mold
|
2020-09-29 09:05:29 +03:00
|
|
|
|
2020-12-11 16:17:21 +03:00
|
|
|
.PHONY: intel_tbb test clean
|