forked from rui314/mold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 944 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CC=clang
CXX=clang++
CURRENT_DIR=$(shell pwd)
TBB_LIBDIR=$(wildcard $(CURRENT_DIR)/oneTBB/build/linux_intel64_*_release/)
MALLOC_LIBDIR=$(CURRENT_DIR)/mimalloc/out/release
CPPFLAGS=-g -IoneTBB/include -pthread -std=c++20 -Wno-deprecated-volatile \
-Wno-switch -O2
LDFLAGS=-L$(TBB_LIBDIR) -Wl,-rpath=$(TBB_LIBDIR) \
-L$(MALLOC_LIBDIR) -Wl,-rpath=$(MALLOC_LIBDIR)
LIBS=-lcrypto -pthread -ltbb -lmimalloc
OBJS=main.o object_file.o input_sections.o output_chunks.o mapfile.o perf.o \
linker_script.o archive_file.o output_file.o subprocess.o gc_sections.o \
icf.o
mold: $(OBJS)
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
$(OBJS): mold.h elf.h Makefile
submodules:
$(MAKE) -C oneTBB
mkdir -p mimalloc/out/release
(cd mimalloc/out/release; cmake ../..)
$(MAKE) -C mimalloc/out/release
test: mold
(cd test; for i in *.sh; do ./$$i || exit 1; done)
clean:
rm -f *.o *~ mold
.PHONY: intel_tbb test clean