File tree Expand file tree Collapse file tree 1 file changed +13
-16
lines changed
Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change 11PROJECT = CodeAstra
22BUILD_DIR = $(PWD ) /build
3- EXECUTABLE = $(PROJECT )
43
5- # Set CMake options
64CMAKE_OPTIONS = ..
75
8- # Default target: Run CMake and install the project
9- all : build install
6+ .PHONY : all build clean install build_tests test
7+
8+ all : install
109
11- # Run CMake to build the project
1210build :
13- @echo " Building $( PROJECT) with CMake ..."
11+ @echo " Building $( PROJECT) ..."
1412 @mkdir -p $(BUILD_DIR )
1513 @cd $(BUILD_DIR ) && cmake $(CMAKE_OPTIONS )
1614
17- # Clean the build directory
1815clean :
1916 @echo " Cleaning the build directory..."
2017 @rm -rf $(BUILD_DIR )
2118
22- # Uninstalling the software
23- uninstall : clean
24- @echo " Uninstalling $( PROJECT) ..."
25- @rm -f $(EXECUTABLE )
26-
27- # Install the project
2819install : build
2920 @echo " Installing $( PROJECT) ..."
30- @cd $(BUILD_DIR ) && make
31- @echo " $( PROJECT ) installed ."
21+ @cmake --build $(BUILD_DIR )
22+ @echo " Installation complete ."
3223
3324build_tests : build
34- @cd $(BUILD_DIR ) /tests/ && make
25+ @echo " Building tests..."
26+ @$(MAKE ) -C $(BUILD_DIR ) /tests
3527
3628test : build_tests
29+ @echo " Running tests..."
3730 @for test in ./build/tests/test_* ; do \
3831 if [ -f $$ test ]; then \
3932 echo " Running $$ test..." ; \
4033 $$ test; \
4134 fi ; \
4235 done
36+
37+ run :
38+ @echo " Running $( PROJECT) ..."
39+ @./build/bin/$(PROJECT )
You can’t perform that action at this time.
0 commit comments