-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: small fixes to Makefile and Readme
- Loading branch information
1 parent
1c7b2b4
commit e996095
Showing
2 changed files
with
54 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
BUILD_TYPE ?= "Debug" | ||
DIR = ".build-$(BUILD_TYPE)" | ||
THIS_FILE := $(abspath $(firstword $(MAKEFILE_LIST))) | ||
THIS_DIR := $(dir $(THIS_FILE)) | ||
|
||
GIT_ROOT := $(shell git -C "$(THIS_DIR)" rev-parse --show-toplevel) | ||
GIT_REPO := $(shell git config --file $(THIS_DIR)/.git/config --get remote.origin.url) | ||
GIT_REPO_NAME := $(shell basename -s .git $(GIT_REPO)) | ||
|
||
BUILD_TYPE ?= Debug | ||
BUILD_DIR = $(GIT_ROOT)/.build-$(BUILD_TYPE) | ||
|
||
.PHONY: \ | ||
build | ||
build \ | ||
clean \ | ||
init \ | ||
tidy | ||
|
||
$(BUILD_DIR): | ||
@mkdir -p "$(BUILD_DIR)" | ||
|
||
build: $(BUILD_DIR) | ||
@cmake -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" -S . -B "$(BUILD_DIR)" | ||
@make -j -C "$(BUILD_DIR)" install | ||
|
||
$(DIR): | ||
mkdir -p "$(DIR)" | ||
clean: | ||
@rm -rf "$(BUILD_DIR)" | ||
@rm -rf "$(GIT_ROOT)/.tidyall.d" | ||
|
||
build: | ||
@cmake -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" -S . -B "$(DIR)" | ||
@make -j -C "$(DIR)" install | ||
init: | ||
@git -C "$(GIT_ROOT)" submodule update --init | ||
|
||
tidy: | ||
@cp -f "$(shell git rev-parse --show-toplevel)/.clang-format" /tmp | ||
@cp -f "$(GIT_ROOT)/.clang-format" /tmp | ||
@tidyall -a -j 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters