parent
0ebbcc602c
commit
0ae7e24470
116
makefile
116
makefile
@ -32,8 +32,8 @@ UNITTEST_SOURCES := test/unittest/test_main.cpp
|
|||||||
test/unittest/shellmatta_utils/test_utils_forwardCursor.cpp \
|
test/unittest/shellmatta_utils/test_utils_forwardCursor.cpp \
|
||||||
test/unittest/shellmatta_utils/test_utils_clearInput.cpp \
|
test/unittest/shellmatta_utils/test_utils_clearInput.cpp \
|
||||||
test/unittest/shellmatta_utils/test_utils_insertChars.cpp \
|
test/unittest/shellmatta_utils/test_utils_insertChars.cpp \
|
||||||
test/unittest/shellmatta_utils/test_utils_terminateInput.cpp \
|
test/unittest/shellmatta_utils/test_utils_terminateInput.cpp \
|
||||||
test/unittest/shellmatta_utils/test_utils_removeChars.cpp \
|
test/unittest/shellmatta_utils/test_utils_removeChars.cpp \
|
||||||
test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp \
|
test/unittest/shellmatta_autocomplete/test_autocomplete_run.cpp \
|
||||||
test/unittest/shellmatta_escape/test_escape_processArrowKeys.cpp \
|
test/unittest/shellmatta_escape/test_escape_processArrowKeys.cpp \
|
||||||
test/unittest/shellmatta_history/test_appendHistoryByte.cpp \
|
test/unittest/shellmatta_history/test_appendHistoryByte.cpp \
|
||||||
@ -73,87 +73,87 @@ DEPS := $(OBJ:%.o=%.d)
|
|||||||
export
|
export
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo Shellmatta help
|
@echo Shellmatta help
|
||||||
@echo -----------------------------------------------
|
@echo -----------------------------------------------
|
||||||
@echo test - run all tests
|
@echo test - run all tests
|
||||||
@echo cppcheck - run static code analysis (cppcheck)
|
@echo cppcheck - run static code analysis (cppcheck)
|
||||||
@echo example - build example
|
@echo example - build example
|
||||||
@echo -----------------------------------------------
|
@echo -----------------------------------------------
|
||||||
|
|
||||||
test: unittest integrationtest
|
test: unittest integrationtest
|
||||||
|
|
||||||
cppcheck:
|
cppcheck:
|
||||||
- @mkdir -p output/cppcheck/html
|
- @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)
|
||||||
cppcheck --enable=all --template=gcc --cppcheck-build-dir=output/cppcheck $(SOURCES) --xml 2>output/cppcheck/cppcheck.xml
|
cppcheck --enable=all --template=gcc --cppcheck-build-dir=output/cppcheck $(SOURCES) --xml 2>output/cppcheck/cppcheck.xml
|
||||||
cppcheck-htmlreport --file=output/cppcheck/cppcheck.xml --title="Shellmatta" --report-dir=output/cppcheck/html
|
cppcheck-htmlreport --file=output/cppcheck/cppcheck.xml --title="Shellmatta" --report-dir=output/cppcheck/html
|
||||||
|
|
||||||
unittest: $(UNITTEST_TARGET)
|
unittest: $(UNITTEST_TARGET)
|
||||||
- @mkdir -p output/test/unittest/report
|
- @mkdir -p output/test/unittest/report
|
||||||
@echo running test:
|
@echo running test:
|
||||||
@# remove coverage from former run
|
@# remove coverage from former run
|
||||||
@-find . -name "*.gcda" -type f -delete
|
@-find . -name "*.gcda" -type f -delete
|
||||||
-$(UNITTEST_TARGET)
|
-$(UNITTEST_TARGET)
|
||||||
@#gcov -o output/test/unittest $(UNITTEST_CPPOBJ) -r src
|
@#gcov -o output/test/unittest $(UNITTEST_CPPOBJ) -r src
|
||||||
|
|
||||||
@# remove report from former run
|
@# remove report from former run
|
||||||
-rm -rf $(OBJ_DIR)test/unittest/report/*
|
-rm -rf $(OBJ_DIR)test/unittest/report/*
|
||||||
gcovr --html-details --output $(OBJ_DIR)test/unittest/report/report.html output/test/unittest -f src -f api
|
gcovr --html-details --output $(OBJ_DIR)test/unittest/report/report.html output/test/unittest -f src -f api
|
||||||
@#-rm *.gcov
|
@#-rm *.gcov
|
||||||
|
|
||||||
integrationtest: $(INTEGRATIONTEST_TARGET)
|
integrationtest: $(INTEGRATIONTEST_TARGET)
|
||||||
- @mkdir -p output/test/integrationtest/report
|
- @mkdir -p output/test/integrationtest/report
|
||||||
@echo running test:
|
@echo running test:
|
||||||
-$(INTEGRATIONTEST_TARGET)
|
-$(INTEGRATIONTEST_TARGET)
|
||||||
#gcov -o output/test $(TEST_CPPOBJ) -r
|
#gcov -o output/test $(TEST_CPPOBJ) -r
|
||||||
gcovr --html-details --output $(OBJ_DIR)test/integrationtest/report/report.html output/src -f src -f api
|
gcovr --html-details --output $(OBJ_DIR)test/integrationtest/report/report.html output/src -f src -f api
|
||||||
#-rm *.gcov
|
#-rm *.gcov
|
||||||
|
|
||||||
example: $(EXAMPLE_TARGET)
|
example: $(EXAMPLE_TARGET)
|
||||||
@echo building example
|
@echo building example
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
- @mkdir -p output/doc/html
|
- @mkdir -p output/doc/html
|
||||||
- @mkdir -p output/doc/latex
|
- @mkdir -p output/doc/latex
|
||||||
doxygen cfg/doxygen/doxyfile
|
doxygen cfg/doxygen/doxyfile
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
- rm -rf $(OBJ_DIR)
|
- rm -rf $(OBJ_DIR)
|
||||||
|
|
||||||
$(EXAMPLE_TARGET): $(COBJ) $(EXAMPLE_COBJ)
|
$(EXAMPLE_TARGET): $(COBJ) $(EXAMPLE_COBJ)
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
$(CC) $(LFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
$(CC) $(LFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
$(UNITTEST_TARGET): $(UNITTEST_CPPOBJ)
|
$(UNITTEST_TARGET): $(UNITTEST_CPPOBJ)
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
$(CPP) $(TESTLFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
$(CPP) $(TESTLFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
$(INTEGRATIONTEST_TARGET): $(INTEGRATIONTEST_CPPOBJ) $(COBJ)
|
$(INTEGRATIONTEST_TARGET): $(INTEGRATIONTEST_CPPOBJ) $(COBJ)
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
$(CPP) $(TESTLFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
$(CPP) $(TESTLFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
$(TARGET): $(OBJ)
|
$(TARGET): $(OBJ)
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
$(CC) $(LFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
$(CC) $(LFLAGS) $(LIB_PATH) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
$(COBJ):
|
$(COBJ):
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
@$(CC) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
@$(CC) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
||||||
$(CC) -c $(CFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
$(CC) -c $(CFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
||||||
|
|
||||||
$(EXAMPLE_COBJ):
|
$(EXAMPLE_COBJ):
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
@$(CC) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
@$(CC) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
||||||
$(CC) -c $(CFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
$(CC) -c $(CFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
||||||
|
|
||||||
$(UNITTEST_CPPOBJ) $(INTEGRATIONTEST_CPPOBJ):
|
$(UNITTEST_CPPOBJ) $(INTEGRATIONTEST_CPPOBJ):
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
@$(CPP) -c $(TESTFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.cpp))
|
@$(CPP) -c $(TESTFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.cpp))
|
||||||
$(CPP) -c $(TESTFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.cpp))
|
$(CPP) -c $(TESTFLAGS) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.cpp))
|
||||||
|
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
- @mkdir -p $(@D)
|
- @mkdir -p $(@D)
|
||||||
@$(CPP) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
@$(CPP) -c $(CFLAGS) $(DEPEND) -o $@ $(subst $(OBJ_DIR), ,$(@:%.o=%.c))
|
||||||
$(CPP) -c $(CFLAGS) -o $@ $<
|
$(CPP) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
Loading…
Reference in New Issue
Block a user