github.com/aergoio/aergo@v1.3.1/Makefile (about)

     1  #
     2  # @file     Makefile
     3  # @copyright defined in aergo/LICENSE.txt
     4  #
     5  
     6  .SUFFIXES:
     7  
     8  CMAKE_CMD ?= cmake
     9  
    10  BUILD_DIR := build
    11  BUILD_FILE := $(BUILD_DIR)/Makefile
    12  
    13  ifeq ($(OS),Windows_NT)
    14      ifneq ($(filter MINGW%,$(shell uname 2>/dev/null || echo Unknown)),)
    15  	    MAKE_FLAG := -D CMAKE_MAKE_PROGRAM=mingw32-make.exe
    16      endif
    17  endif
    18  
    19  BUILD_RULES := \
    20  	deps \
    21  	aergocli aergosvr aergoluac polaris colaris brick \
    22  	libtool libtool-clean \
    23  	libluajit liblmdb libgmp \
    24  	libluajit-clean liblmdb-clean libgmp-clean \
    25  	check cover-check \
    26  	distclean \
    27  	protoc protoclean
    28  
    29  .PHONY: all release debug clean $(BUILD_RULES)
    30  
    31  all: $(BUILD_FILE)
    32  	@$(MAKE) --no-print-directory -C $(BUILD_DIR)
    33  
    34  $(BUILD_DIR):
    35  	@mkdir -p $(BUILD_DIR)
    36  
    37  $(BUILD_FILE): $(BUILD_DIR)
    38  	@if ! [ -f $(BUILD_FILE) ]; then \
    39  		cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Release" $(MAKE_FLAG) ..; \
    40  	fi
    41  
    42  release: $(BUILD_DIR)
    43  	cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Release" $(MAKE_FLAG) ..
    44  	@$(MAKE) --no-print-directory -C $(BUILD_DIR)
    45  
    46  debug: $(BUILD_DIR)
    47  	@cd $(BUILD_DIR) && $(CMAKE_CMD) -G "Unix Makefiles" -D CMAKE_BUILD_TYPE="Debug" $(MAKE_FLAG) ..
    48  	@$(MAKE) --no-print-directory -C $(BUILD_DIR)
    49  
    50  clean:
    51  	@$(MAKE) --no-print-directory -C $(BUILD_DIR) distclean
    52  
    53  realclean: clean
    54  	@rm -rf $(BUILD_DIR)
    55  
    56  $(BUILD_RULES): $(BUILD_FILE)
    57  	@$(MAKE) --no-print-directory -C $(BUILD_DIR) $@