improving Makefile
This commit is contained in:
@@ -54,3 +54,7 @@ dkms.conf
|
|||||||
# documentation
|
# documentation
|
||||||
|
|
||||||
doc/*
|
doc/*
|
||||||
|
|
||||||
|
|
||||||
|
# build directory
|
||||||
|
beluga-output/
|
||||||
|
|||||||
@@ -4,7 +4,27 @@
|
|||||||
# @file
|
# @file
|
||||||
# @version 0.1
|
# @version 0.1
|
||||||
|
|
||||||
app: main.c main.h
|
BELUGA_OUTPUT=beluga-output
|
||||||
$(CC) main.c -o main -Wall -Wextra -pedantic
|
|
||||||
|
BUILD_DIR=build
|
||||||
|
|
||||||
|
BUILD_FLAGS=-Wall -Wextra -pedantic
|
||||||
|
|
||||||
|
build: main.c main.h
|
||||||
|
if [ ! -d beluga-output ]; then mkdir beluga-output; fi
|
||||||
|
if [ ! -d beluga-output/build ]; then mkdir beluga-output/build; fi
|
||||||
|
$(CC) main.c -o $(BELUGA_OUTPUT)/$(BUILD_DIR)/beluga $(BUILD_FLAGS)
|
||||||
|
|
||||||
|
DEBUG_DIR=debug
|
||||||
|
|
||||||
|
DEBUG_FLAGS=-Wall -Wextra -pedantic -Werror -fsanitize=address,undefined -g
|
||||||
|
|
||||||
|
debug: main.c main.h
|
||||||
|
if [ ! -d beluga-output ]; then mkdir beluga-output; fi
|
||||||
|
if [ ! -d beluga-output/debug ]; then mkdir beluga-output/debug; fi
|
||||||
|
$(CC) main.c -o $(BELUGA_OUTPUT)/$(DEBUG_DIR)/beluga $(DEBUG_FLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BELUGA-OUTPUT)
|
||||||
|
|
||||||
# end
|
# end
|
||||||
|
|||||||
Reference in New Issue
Block a user