forked from aergoio/aergo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 1.08 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
#
# @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
.PHONY: all release debug clean
all: $(BUILD_FILE)
@$(MAKE) --no-print-directory -C $(BUILD_DIR)
$(BUILD_FILE):
@mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Release" $(MAKE_FLAG) ..
release:
@mkdir -p $(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:
@mkdir -p $(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_DIR)
@$(MAKE) --no-print-directory -C $(BUILD_DIR) $(MAKECMDGOALS)