2022-04-20 18:10:00 +00:00
|
|
|
WERROR?=
|
|
|
|
CFLAGS=-Wall -Wextra $(WERROR) -pedantic -I.
|
|
|
|
CXXFLAGS_WITHOUT_PKGS=$(CFLAGS) -fno-exceptions -Wno-missing-braces -Wswitch-enum -lm
|
|
|
|
|
2022-04-30 14:16:37 +00:00
|
|
|
TEST_SRCS_ENC := $(foreach DIR,src,$(patsubst $(DIR)/%,%,$(wildcard ./src/*.c)))
|
|
|
|
TEST_SRCS_ENC := $(filter-out %main.c, $(TEST_SRCS_ENC))
|
|
|
|
|
2022-04-20 18:10:00 +00:00
|
|
|
build:
|
2022-04-30 14:16:37 +00:00
|
|
|
gcc src/* -o ./bin/main ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
test:
|
|
|
|
gcc ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
./bin/test
|