-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
57 lines (45 loc) · 1.4 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
all: lz-ani
# *** REFRESH makefile utils
include refresh.mk
$(call INIT_SUBMODULES)
$(call INIT_GLOBALS)
$(call CHECK_OS_ARCH, $(PLATFORM))
# *** Project directories
$(call SET_SRC_OBJ_BIN,src,obj,bin)
3RD_PARTY_DIR := ./libs
# *** Project configuration
$(call CHECK_NASM)
$(call PROPOSE_ZLIB_NG, $(3RD_PARTY_DIR)/zlib-ng)
$(call PROPOSE_ISAL, $(3RD_PARTY_DIR)/isa-l)
$(call ADD_MIMALLOC, $(3RD_PARTY_DIR)/mimalloc)
$(call CHOOSE_GZIP_DECOMPRESSION)
$(call ADD_REFRESH_LIB, $(3RD_PARTY_DIR))
$(call SET_STATIC, $(STATIC_LINK))
$(call SET_C_CPP_STANDARDS, c11, c++20)
$(call SET_GIT_COMMIT)
$(call SET_FLAGS, $(TYPE))
$(call SET_COMPILER_VERSION_ALLOWED, GCC, Linux_x86_64, 10, 20)
$(call SET_COMPILER_VERSION_ALLOWED, GCC, Linux_aarch64, 11, 20)
$(call SET_COMPILER_VERSION_ALLOWED, GCC, Darwin_x86_64, 11, 13)
$(call SET_COMPILER_VERSION_ALLOWED, GCC, Darwin_arm64, 11, 13)
ifneq ($(MAKECMDGOALS),clean)
$(call CHECK_COMPILER_VERSION)
endif
# *** Source files and rules
$(eval $(call PREPARE_DEFAULT_COMPILE_RULE,MAIN,.))
# *** Targets
lz-ani: $(OUT_BIN_DIR)/lz-ani
$(OUT_BIN_DIR)/lz-ani: $(GZ_TARGET) mimalloc_obj \
$(OBJ_MAIN)
-mkdir -p $(OUT_BIN_DIR)
$(CXX) -o $@ \
$(MIMALLOC_OBJ) \
$(OBJ_MAIN) \
$(LIBRARY_FILES) $(LINKER_FLAGS) $(LINKER_DIRS)
# *** Cleaning
.PHONY: clean init
clean: clean-zlib-ng clean-isa-l clean-mimalloc_obj
-rm -r $(OBJ_DIR)
-rm -r $(OUT_BIN_DIR)
init:
$(call INIT_SUBMODULES)