generated from gvatsal60/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
0dbeea8
commit e55324e
Showing
8 changed files
with
38 additions
and
29 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
... |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ else | |
include Makefiles/out.mk | ||
endif | ||
|
||
.PHONY: all test clean | ||
.PHONY: all test clean |
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
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,42 +1,40 @@ | ||
include Makefiles/docker.mk | ||
|
||
BUILD_CMD := bazel build //$(TOP_DIR):all | ||
TEST_CMD := bazel test //$(TOP_DIR):test | ||
RUN_CMD := bazel run //$(TOP_DIR):prog | ||
CLEAN_CMD := bazel clean | ||
SONAR_CMD := bazel run @hedron_compile_commands//:refresh_all -- --compilation_mode=dbg | ||
include Makefiles/rules.mk | ||
|
||
# Define the path to the Dockerfile | ||
DOCKER_FILE_PATH := dockerfiles/Dockerfile | ||
|
||
DOCKER_BUILD_CMD := $(DOCKER_HOST) image build -t $(DOCKER_IMG_NAME) -f $(DOCKER_FILE_PATH) $(DOCKER_BUILD_CONTEXT) | ||
DOCKER_RUN_CMD := $(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) | ||
|
||
# Define the default target | ||
.PHONY: all test clean | ||
|
||
# Targets | ||
all: build run | ||
all: clean build | ||
|
||
# Target: build_img | ||
# Description: Builds the Docker image using the specified Dockerfile | ||
.PHONY: build_img | ||
build_img: | ||
@$(DOCKER_HOST) image build -t $(DOCKER_IMG_NAME) -f $(DOCKER_FILE_PATH) $(DOCKER_BUILD_CONTEXT) | ||
@$(DOCKER_BUILD_CMD) | ||
|
||
# Code Build | ||
build: build_img | ||
@$(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) "$(BUILD_CMD)" | ||
@$(DOCKER_RUN_CMD) $(BUILD_CMD) | ||
|
||
# Test code | ||
test: build_img | ||
@$(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) "$(TEST_CMD)" | ||
@$(DOCKER_RUN_CMD) $(TEST_CMD) | ||
|
||
# Run code | ||
run: build_img | ||
@$(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) "$(RUN_CMD)" | ||
@$(DOCKER_RUN_CMD) $(RUN_CMD) | ||
|
||
# Clean | ||
clean: build_img | ||
@$(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) "$(CLEAN_CMD)" | ||
@$(DOCKER_RUN_CMD) $(CLEAN_CMD) | ||
|
||
# Sonar | ||
sonar: clean build | ||
@$(DOCKER_HOST) container run $(DOCKER_ARG) $(DOCKER_IMG_NAME) "$(SONAR_CMD)" | ||
@$(DOCKER_RUN_CMD) $(SONAR_CMD) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
# Targets | ||
.PHONY: all test clean | ||
|
||
BUILD_TOOL := bazel | ||
BUILD_CMD := build //$(TOP_DIR):all | ||
TEST_CMD := test //$(TOP_DIR):test | ||
RUN_CMD := run //$(TOP_DIR):main | ||
CLEAN_CMD := clean --async | ||
SONAR_CMD := run @hedron_compile_commands//:refresh_all -- --compilation_mode=dbg |
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,25 +1,22 @@ | ||
include cfg/.env | ||
include Makefiles/rules.mk | ||
|
||
# Targets | ||
.PHONY: all test clean | ||
|
||
all: | ||
@bazel build //$(TOP_DIR):all | ||
all: clean build | ||
|
||
build: | ||
@bazel build //$(TOP_DIR):all | ||
@$(BUILD_TOOL) $(BUILD_CMD) | ||
|
||
test: | ||
@bazel test //$(TOP_DIR):test | ||
@$(BUILD_TOOL) $(TEST_CMD) | ||
|
||
run: | ||
@bazel run //$(TOP_DIR):main | ||
@$(BUILD_TOOL) $(RUN_CMD) | ||
|
||
clean_json: | ||
@rm -rf compile_commands.json | ||
|
||
clean: clean_json | ||
@bazel clean --async | ||
clean: | ||
@$(BUILD_TOOL) $(CLEAN_CMD) | ||
|
||
sonar: clean build | ||
@bazel run @hedron_compile_commands//:refresh_all -- --compilation_mode=dbg | ||
@$(BUILD_TOOL) $(SONAR_CMD) |
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
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