Added Makefile cmake wrapper
This commit is contained in:
parent
6a203b3fe5
commit
d83fb29d6b
4 changed files with 57 additions and 48 deletions
45
Makefile
Normal file
45
Makefile
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
SRC_DIR=src
|
||||
RELEASE_DIR=build/release
|
||||
DEBUG_DIR=build/debug
|
||||
|
||||
all: debug
|
||||
.PHONY: all
|
||||
|
||||
|
||||
clean:
|
||||
@ rm -rf build
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
# Release
|
||||
run-release: release
|
||||
@ ./$(RELEASE_DIR)
|
||||
.PHONY: run-release
|
||||
|
||||
release: $(RELEASE_DIR)/Makefile
|
||||
@ make -C $(RELEASE_DIR)
|
||||
.PHONY: release
|
||||
|
||||
$(RELEASE_DIR)/Makefile: $(SRC_DIR)/CMakeLists.txt
|
||||
@ cmake -H$(SRC_DIR) -B$(RELEASE_DIR) -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
clean-release:
|
||||
@ rm -rf build/release
|
||||
.PHONY: clean-release
|
||||
|
||||
|
||||
# Debug
|
||||
run-debug: debug
|
||||
@ ./$(DEBUG_DIR)
|
||||
.PHONY: run-debug
|
||||
|
||||
debug: $(DEBUG_DIR)/Makefile
|
||||
@ make -C $(DEBUG_DIR)
|
||||
.PHONY: debug
|
||||
|
||||
$(DEBUG_DIR)/Makefile: $(SRC_DIR)/CMakeLists.txt
|
||||
@ cmake -H$(SRC_DIR) -B$(DEBUG_DIR) -DCMAKE_BUILD_TYPE=Debug
|
||||
|
||||
clean-debug:
|
||||
@ rm -rf build/debug
|
||||
.PHONY: clean-debug
|
||||
Reference in a new issue