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-05-21 16:38:26 +00:00
|
|
|
cp src/config_env_main.h src/config_env.h
|
2022-04-30 14:16:37 +00:00
|
|
|
gcc src/* -o ./bin/main ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
test:
|
2022-05-21 16:38:26 +00:00
|
|
|
cp src/config_env_main.h src/config_env.h
|
2022-04-30 14:16:37 +00:00
|
|
|
gcc ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
./bin/test
|
2022-05-21 16:38:26 +00:00
|
|
|
test-no-run: ./tests/*
|
|
|
|
cp src/config_env_main.h src/config_env.h
|
2022-05-15 16:46:16 +00:00
|
|
|
gcc ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
2022-05-21 16:38:26 +00:00
|
|
|
test-debug: ./tests/*
|
|
|
|
cp src/config_env_main.h src/config_env.h
|
|
|
|
gcc -g ${TEST_SRCS_ENC} ./tests/* -o ./bin/test ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
emscripten:
|
|
|
|
cp wasm/config_env_wasm.h src/config_env.h
|
|
|
|
emcc -O3 -s WASM=1 -s EXPORTED_RUNTIME_METHODS=ccall,cwrap,getValue,setValue \
|
|
|
|
./wasm/emscripten.c ${TEST_SRCS_ENC} -o wasm/langatator_adapter.js
|
2022-05-06 09:49:09 +00:00
|
|
|
sandbox:
|
|
|
|
gcc ${TEST_SRCS_ENC} ./sandbox.c -o ./bin/sandbox ${CXXFLAGS_WITHOUT_PKGS}
|
|
|
|
./bin/sandbox
|