-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
57 lines (43 loc) · 1.38 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
57
#
# @file Makefile
# @copyright defined in aergo/LICENSE.txt
#
.SUFFIXES:
CMAKE_CMD ?= cmake
BUILD_DIR := build
BUILD_FILE := $(BUILD_DIR)/Makefile
ifeq ($(OS),Windows_NT)
ifneq ($(filter MINGW%,$(shell uname 2>/dev/null || echo Unknown)),)
MAKE_FLAG := -D CMAKE_MAKE_PROGRAM=mingw32-make.exe
endif
endif
BUILD_RULES := \
deps \
aergocli aergosvr aergoluac polaris colaris brick mpdumpdiag\
libtool libtool-clean \
libluajit liblmdb libgmp \
libluajit-clean liblmdb-clean libgmp-clean \
check cover-check \
distclean \
protoc protoclean
.PHONY: all release debug clean $(BUILD_RULES)
all: $(BUILD_FILE)
@$(MAKE) --no-print-directory -C $(BUILD_DIR)
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)
$(BUILD_FILE): $(BUILD_DIR)
@if ! [ -f $(BUILD_FILE) ]; then \
cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Release" $(MAKE_FLAG) ..; \
fi
release: $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Release" $(MAKE_FLAG) ..
@$(MAKE) --no-print-directory -C $(BUILD_DIR)
debug: $(BUILD_DIR)
@cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Debug" $(MAKE_FLAG) ..
@$(MAKE) --no-print-directory -C $(BUILD_DIR)
clean:
@$(MAKE) --no-print-directory -C $(BUILD_DIR) distclean
realclean: clean
@rm -rf $(BUILD_DIR)
$(BUILD_RULES): $(BUILD_FILE)
@$(MAKE) --no-print-directory -C $(BUILD_DIR) $@