|
@@ -14,6 +14,7 @@ INTEGRATIONTEST_C_OBJ_DIR := $(INTEGRATIONTEST_CPP_OBJ_DIR)
|
|
|
INTEGRATIONTEST_AUTH_C_OBJ_DIR := $(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)
|
|
|
UNITTEST_OBJ_DIR := $(OBJ_DIR)test/unittest/
|
|
|
|
|
|
+# helper define to run tests from a list
|
|
|
define \n
|
|
|
|
|
|
|
|
@@ -30,6 +31,20 @@ SOURCES := src/shellmatta.c \
|
|
|
src/shellmatta_escape.c \
|
|
|
src/shellmatta_opt.c
|
|
|
|
|
|
+AUTH_SOURCES := $(SOURCES) src/shellmatta_auth.c
|
|
|
+EXAMPLE_SOURCES := $(AUTH_SOURCES) example/main.c
|
|
|
+EXAMPLE_COBJ := $(patsubst %.c,$(OBJ_DIR_EXAMPLE)%.o,$(EXAMPLE_SOURCES))
|
|
|
+
|
|
|
+CPPCHECK_SOURCES := $(AUTH_SOURCES)
|
|
|
+CPPCHECK_OPTIONS := --enable=all \
|
|
|
+ --check-level=exhaustive \
|
|
|
+ --template=gcc \
|
|
|
+ --cppcheck-build-dir=output/cppcheck \
|
|
|
+ --suppress-xml=cfg/cppcheck/cppcheck_suppressions.xml \
|
|
|
+ -DSHELLMATTA_AUTHENTICATION \
|
|
|
+ -Iapi \
|
|
|
+ $(CPPCHECK_SOURCES)
|
|
|
+
|
|
|
INCLUDES := api .
|
|
|
|
|
|
UNITTEST_SOURCES := test/unittest/test_main.cpp \
|
|
@@ -69,7 +84,7 @@ INTEGRATIONTEST_CPPOBJ := $(patsubst %.cpp,$(INTEGRATIONTEST_CPP_OBJ_DIR)%.o,$
|
|
|
INTEGRATIONTEST_COBJ := $(patsubst %.c,$(INTEGRATIONTEST_CPP_OBJ_DIR)%.o,$(SOURCES))
|
|
|
|
|
|
INTEGRATIONTEST_AUTH_CPPOBJ := $(patsubst %.cpp,$(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)%.o,$(INTEGRATIONTEST_AUTH_SOURCES))
|
|
|
-INTEGRATIONTEST_AUTH_COBJ := $(patsubst %.c,$(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)%.o,$(SOURCES) src/shellmatta_auth.c)
|
|
|
+INTEGRATIONTEST_AUTH_COBJ := $(patsubst %.c,$(INTEGRATIONTEST_AUTH_CPP_OBJ_DIR)%.o,$(AUTH_SOURCES))
|
|
|
|
|
|
CFLAGS := $(INCLUDES:%=-I%) -g -Wall -Werror -Wextra -pedantic -DSHELLMATTA_HELP_ALIAS=\(char*\)\"?\"
|
|
|
CFLAGS_EXAMPLE = $(CFLAGS) -DSHELLMATTA_AUTHENTICATION
|
|
@@ -81,9 +96,6 @@ DEPEND = -MT $@ -MF "$(@:%.o=%.d)" -MG -MM
|
|
|
|
|
|
COBJ := $(patsubst %.c,$(OBJ_DIR)%.o,$(SOURCES))
|
|
|
|
|
|
-EXAMPLE_SOURCES := $(SOURCES) src/shellmatta_auth.c example/main.c
|
|
|
-EXAMPLE_COBJ := $(patsubst %.c,$(OBJ_DIR_EXAMPLE)%.o,$(EXAMPLE_SOURCES))
|
|
|
-
|
|
|
EXAMPLE_TARGET := $(OBJ_DIR)example/example
|
|
|
|
|
|
UNITTEST_TARGET := $(OBJ_DIR)test/unittest/unittest
|
|
@@ -125,8 +137,8 @@ test: $(TEST_RUN_TARGETS)
|
|
|
|
|
|
cppcheck:
|
|
|
- @mkdir -p output/cppcheck/html
|
|
|
- cppcheck --enable=all --template=gcc --cppcheck-build-dir=output/cppcheck $(SOURCES)
|
|
|
- cppcheck --enable=all --template=gcc --cppcheck-build-dir=output/cppcheck $(SOURCES) --xml 2>output/cppcheck/cppcheck.xml
|
|
|
+ cppcheck $(CPPCHECK_OPTIONS)
|
|
|
+ cppcheck $(CPPCHECK_OPTIONS) --xml 2>output/cppcheck/cppcheck.xml
|
|
|
cppcheck-htmlreport --file=output/cppcheck/cppcheck.xml --title="Shellmatta" --report-dir=output/cppcheck/html
|
|
|
|
|
|
|