diff --git a/.gitHooks/pre-commit b/.gitHooks/pre-commit index 7b4cef7..87bbbde 100644 --- a/.gitHooks/pre-commit +++ b/.gitHooks/pre-commit @@ -4,7 +4,7 @@ # availabilty of python py=$(which py || which python || which python3) if [[ -z $py ]] -then +then echo "No python found" exit 0 fi @@ -15,22 +15,22 @@ cd $(git rev-parse --show-toplevel) # path to sompy python scripts sompy=$(pwd)/submodules/sompy/somutil -# files regarded as text files to be cleaned -txts= -# extensions of text files sorted by likeliness -xtxt="h cpp cmd py md lua" +# files to skip +skips="*/Makefile */*.make" + +txts=() for file in $(git diff-index --cached --name-only HEAD); do - if [[ -f $file ]] - then - for ext in $xtxt; do - if [[ $file == *.$ext ]]; then txts="$txts $file"; break; fi + if [ -f $file ]; then + ok=true + for s in $skips; do + if [[ $file == $s ]]; then ok=false; break; fi done + if $ok; then txts+=($file); fi fi done -if [[ -n $txts ]]; then - echo cleaning text files - $py $sompy/cleanTxt.py -l $txts -fi -for file in $txts; do git add $file; done +echo txt: ${#txts[@]} +done=$($py $sompy/cleanTxt.py -le ${txts[@]}) + +for file in $done; do git add $file; done diff --git a/.gitignore b/.gitignore index 5e93954..55df2b0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,15 +8,16 @@ tmp/ stuff *.cov *.html +vs +lab.make # temporary ignored -# Makefile -# *.make *.sln *.vcxproj *.vcxproj.* .vs .vscode +.obsidian # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/make/Makefile b/make/Makefile index 42e5b55..ea1431f 100644 --- a/make/Makefile +++ b/make/Makefile @@ -1,4 +1,4 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake +# GNU Make workspace makefile autogenerated by Premake ifndef config config=ci diff --git a/make/README.md b/make/README.md index bd4a809..bfa8a3e 100644 --- a/make/README.md +++ b/make/README.md @@ -6,7 +6,7 @@ covbr2html/make$> make -j ```` - find binary in build folder ````shell -covbr2html/make$> cd ../build +covbr2html/make$> cd ../build/linux covbr2html/build$> ls ```` @@ -20,10 +20,11 @@ covbr2html\make> premake5 vsNNNN ```` ### build ````shell -covbr2html\make> msbuild -m covbr2html.sln +covbr2html\make> cd ../vs +covbr2html\vs> msbuild -m covbr2html.sln ```` - find binary in build folder ````shell -covbr2html\make> cd ../build -covbr2html\build> dir /B *.exe +covbr2html\vs> cd ../build/windows +covbr2html\build\windows> dir /B *.exe ```` diff --git a/make/covbr2html.make b/make/covbr2html.make index 43383e7..f29d228 100644 --- a/make/covbr2html.make +++ b/make/covbr2html.make @@ -1,4 +1,4 @@ -# Alternative GNU Make project makefile autogenerated by Premake +# GNU Make project makefile autogenerated by Premake ifndef config config=ci @@ -18,8 +18,17 @@ endif # Configurations # ############################################# +ifeq ($(origin CC), default) + CC = gcc +endif +ifeq ($(origin CXX), default) + CXX = g++ +endif +ifeq ($(origin AR), default) + AR = ar +endif RESCOMP = windres -TARGETDIR = ../build +TARGETDIR = ../build/linux TARGET = $(TARGETDIR)/covbr2html INCLUDES += -I../code -I../submodules/somcpp/include FORCE_INCLUDE += diff --git a/make/lab.make b/make/lab.make deleted file mode 100644 index 5bbec6b..0000000 --- a/make/lab.make +++ /dev/null @@ -1,147 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=ci -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq ($(shell echo "test"), "test") - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -TARGETDIR = ../build -TARGET = $(TARGETDIR)/lab -INCLUDES += -I../lab -I../code -I../submodules/somcpp/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++17 -O3 -pedantic-errors -Wall -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++17 -O3 -pedantic-errors -Wall -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -ALL_LDFLAGS += $(LDFLAGS) -s -pthread -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),ci) -OBJDIR = ../build/linux/ci/ci/lab -DEFINES += -DNDEBUG - -else ifeq ($(config),trace_on) -OBJDIR = ../build/linux/trace_on/trace_on/lab -DEFINES += -DNDEBUG -DTRACE_ON - -else ifeq ($(config),trace_all) -OBJDIR = ../build/linux/trace_all/trace_all/lab -DEFINES += -DNDEBUG -DTRACE_ALL - -endif - -# Per File Configurations -# ############################################# - - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/docopts.o -GENERATED += $(OBJDIR)/fglob.o -GENERATED += $(OBJDIR)/fio.o -OBJECTS += $(OBJDIR)/docopts.o -OBJECTS += $(OBJDIR)/fglob.o -OBJECTS += $(OBJDIR)/fio.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking lab - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning lab -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/docopts.o: ../submodules/somcpp/src/docopts.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/fglob.o: ../submodules/somcpp/src/fglob.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/fio.o: ../submodules/somcpp/src/fio.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/make/premake5.lua b/make/premake5.lua index c9311f0..90f556a 100644 --- a/make/premake5.lua +++ b/make/premake5.lua @@ -10,11 +10,10 @@ somcpp = '../submodules/somcpp/' somsrc = somcpp .. 'src/' workspace 'covbr2html' - configurations { 'ci', 'trace_on', 'trace_all', 'glob_linux', 'glob_linux_trace_all' } language 'C++' - targetdir '../build' - objdir '../build/%{_TARGET_OS}/%{cfg.name}' + targetdir '../build/%{_TARGET_OS}' + objdir '../build/%{_TARGET_OS}' defines { 'NDEBUG' } optimize 'Speed' kind 'ConsoleApp' @@ -23,6 +22,7 @@ workspace 'covbr2html' warnings 'high' buildoptions { buildoptions_vs } defines { '_CRT_SECURE_NO_WARNINGS' } + location '../vs' filter { 'action:gmake*' } buildoptions { buildoptions_gcc } diff --git a/submodules/sompy b/submodules/sompy index c39bb1c..6d5a2d9 160000 --- a/submodules/sompy +++ b/submodules/sompy @@ -1 +1 @@ -Subproject commit c39bb1ce3e0692d04551ebf7675c209ce36bc1a2 +Subproject commit 6d5a2d911b8b7d8a3020941aaba9b2fb462a219c