2023-10-07 00:22:32 +00:00
|
|
|
.PHONY: all test clean build
|
|
|
|
|
|
|
|
SRC = src/main.c
|
|
|
|
OJB = $(SRC:.c=.o)
|
|
|
|
OUT = build
|
|
|
|
|
|
|
|
CC = /usr/bin/gcc
|
2023-10-07 02:13:13 +00:00
|
|
|
CFLAGS = -ansi -Wall -std=c99 -O0
|
|
|
|
CFDEBUG = -ansi -Wall -fsanitize=address -g -std=c99
|
2023-10-07 00:22:32 +00:00
|
|
|
RM = /bin/rm -fr
|
2023-10-07 02:13:13 +00:00
|
|
|
TEST_F = -D TEST_TECH
|
|
|
|
TEST = -D TEST_
|
2023-10-07 00:22:32 +00:00
|
|
|
EVE = -D EVE_
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS)
|
|
|
|
|
|
|
|
build:
|
2023-10-07 02:13:13 +00:00
|
|
|
$(CC) $(SRC) $(TEST)$(test) $(EVE)$(eve) $(CFLAGS) -o $(OUT)/main.o
|
2023-10-07 00:22:32 +00:00
|
|
|
|
|
|
|
build_test:
|
2023-10-07 02:13:13 +00:00
|
|
|
$(CC) $(SRC) $(CFLAGS) $(TEST_F) -o $(OUT)/main.o
|
2023-10-07 00:22:32 +00:00
|
|
|
|
|
|
|
debug:
|
2023-10-07 02:13:13 +00:00
|
|
|
$(CC) $(SRC) $(TEST)$(test) $(CFDEBUG) -o $(OUT)/main.o
|
2023-10-07 00:22:32 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJ) $(OUT)/main.o
|
|
|
|
|
|
|
|
run:
|
|
|
|
$(MAKE) build && ./build/main.o
|
|
|
|
|
|
|
|
test:
|
|
|
|
$(MAKE) build_test && ./build/main.o
|