X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=Makefile;h=4a52c99e5e10b957be61f1f0a43c789dd0214130;hb=c2bf905f4b9863fe0f5c876ed00fe298cb95ab6b;hp=312849578c4fcc86c434e97544350deda77acc02;hpb=f6e33d9f79ff6a47c3efa3c9fb1206cc1d27ecde;p=blank.git diff --git a/Makefile b/Makefile index 3128495..4a52c99 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ CXX = g++ --std=c++11 LDXX = g++ +CPPCHECK = cppcheck -q --std=c++11 \ + --enable=warning,style,performance,portability,unusedFunction,missingInclude \ + --error-exitcode=1 LIBS = sdl2 SDL2_image SDL2_net SDL2_ttf glew openal freealut zlib @@ -151,6 +154,12 @@ codecov: coverage @echo run: codecov.io @bash -c 'bash <(curl -s https://codecov.io/bash) -Z' +lint: + @echo lint: source + @$(CPPCHECK) $(SOURCE_DIR) + @echo lint: tests + @$(CPPCHECK) -I $(SOURCE_DIR) $(TEST_SRC_DIR) + clean: rm -f $(OBJ) rm -f $(DEP) @@ -160,7 +169,7 @@ distclean: clean rm -f $(BIN) cachegrind.out.* callgrind.out.* rm -Rf build client-saves saves -.PHONY: all release cover debug profile tests run gdb cachegrind callgrind test coverage codecov clean distclean +.PHONY: all release cover debug profile tests run gdb cachegrind callgrind test coverage codecov lint clean distclean -include $(DEP) @@ -225,7 +234,7 @@ $(TEST_DIR)/src/%.o: $(SOURCE_DIR)/%.cpp | $(TEST_DIR) @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(TEST_FLAGS) -o $@ -MMD -MP -MF"$(@:.o=.d)" -MT"$@" $< -$(ASSET_DEP): .git/$(shell git symbolic-ref HEAD 2>/dev/null || echo .git/HEAD) +$(ASSET_DEP): .git/$(shell git symbolic-ref HEAD 2>/dev/null || echo HEAD) @echo fetch: assets @git submodule update --init >/dev/null @touch $@