Configured start of project
This commit is contained in:
commit
d7f95f0fbf
6 changed files with 65 additions and 0 deletions
37
Makefile
Normal file
37
Makefile
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# =====CONFIG=====
|
||||
BUILD_DIR := ./build
|
||||
SRC_DIR := ./src
|
||||
TEST_DIR := test
|
||||
CORES != nproc
|
||||
|
||||
SRCS := $(shell find '$(SRC_DIR)' -iname '*.c')
|
||||
|
||||
|
||||
# =====RECIPES=====
|
||||
all: build
|
||||
|
||||
.PHONY: cmake
|
||||
cmake: $(BUILD_DIR)/Debug/Makefile
|
||||
$(BUILD_DIR)/Debug/Makefile: CMakeLists.txt
|
||||
@ cmake -B'$(BUILD_DIR)/Debug' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
|
||||
@ ln -sf '$(BUILD_DIR)/Debug/compile_commands.json' compile_commands.json
|
||||
|
||||
.PHONY: build
|
||||
build: cmake
|
||||
@ make -C '$(BUILD_DIR)/Debug'
|
||||
|
||||
.PHONY: run
|
||||
run: build
|
||||
@ ./build/Debug/lander
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@ rm -rf '$(BUILD_DIR)' compile_commands.json
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@ clang-format --Werror -n $(SRCS)
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
@ clang-format -i $(SRCS)
|
||||
Loading…
Add table
Add a link
Reference in a new issue