17 lines
610 B
Makefile
17 lines
610 B
Makefile
WERROR?=
|
|
CFLAGS=-Wall -Wextra $(WERROR) -pedantic -I.
|
|
CXXFLAGS_WITHOUT_PKGS=$(CFLAGS) -fno-exceptions -Wno-missing-braces -Wswitch-enum -lm
|
|
|
|
TEST_SRCS_ENC := $(foreach DIR,src,$(patsubst $(DIR)/%,%,$(wildcard ./src/*.c)))
|
|
TEST_SRCS_ENC := $(filter-out %main.c, $(TEST_SRCS_ENC))
|
|
|
|
build:
|
|
gcc src/* -o ./bin/main ${CXXFLAGS_WITHOUT_PKGS}
|
|
test:
|
|
gcc ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
|
./bin/test
|
|
test-no-run:
|
|
gcc ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
|
sandbox:
|
|
gcc ${TEST_SRCS_ENC} ./sandbox.c -o ./bin/sandbox ${CXXFLAGS_WITHOUT_PKGS}
|
|
./bin/sandbox
|