From 84f6b520d18d9b2b547e5a71f423fde1f8e4f07e Mon Sep 17 00:00:00 2001 From: Quentin Quadrat Date: Mon, 1 Jul 2024 22:44:15 +0200 Subject: [PATCH] Use MyMakefile-v2 --- .github/workflows/ci.yaml | 8 +-- .makefile | 2 +- Makefile | 107 ++++++++--------------------- Makefile.common | 4 ++ README.md | 2 +- VERSION.txt | 1 - doc/demos/Unzipper/Makefile | 51 ++++---------- doc/doxygen-logo.png | Bin 0 -> 8679 bytes external/compile-external-libs.sh | 2 - external/download-external-libs.sh | 2 - tests/Makefile | 79 ++++++--------------- tests/TestZip.cpp | 6 +- 12 files changed, 74 insertions(+), 190 deletions(-) create mode 100644 Makefile.common delete mode 100644 VERSION.txt create mode 100644 doc/doxygen-logo.png diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cbd62a6..5856330 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,11 +47,11 @@ jobs: run: | cd tests V=1 make -j`nproc --all` - ./build/Zipper-UnitTest + ../build/zipper-tests - name: Check the demo run: | cd doc/demos/Unzipper - echo "1234" | ./build/demo_unzip -p -f -o /tmp ../../../tests/issues/issue_05_password.zip + echo "1234" | ./build/unzipper-demo -p -f -o /tmp ../../../tests/issues/issue_05_password.zip ls /tmp/issue_05/foo/bar /tmp/issue_05/Nouveau\ dossier/ /tmp/issue_05/Nouveau\ fichier\ vide - name: Check if the library can be linked against a project run: | @@ -96,12 +96,12 @@ jobs: run: | cd tests V=1 make -j`nproc --all` - ./build/Zipper-UnitTest + ../build/zipper-tests # FIXME https://github.com/Lecrapouille/zipper/issues/10 # - name: Check the demo # run: | # cd doc/demos/Unzipper -# echo "1234" | ./build/demo_unzip -p -f -o /tmp ../../../tests/issues/issue_05_password.zip +# echo "1234" | ./build/unzipper-demo -p -f -o /tmp ../../../tests/issues/issue_05_password.zip # ls /tmp/issue_05/foo/bar /tmp/issue_05/Nouveau\ dossier/ /tmp/issue_05/Nouveau\ fichier\ vide # - name: Check if the library can be linked against a project # run: | diff --git a/.makefile b/.makefile index 9f5eb26..937c117 160000 --- a/.makefile +++ b/.makefile @@ -1 +1 @@ -Subproject commit 9f5eb268d18c518c30d094b937b1a4274142cd1b +Subproject commit 937c1171b1be522d4051a3372c880b7ee1498ceb diff --git a/Makefile b/Makefile index 5179d4c..5c4b600 100644 --- a/Makefile +++ b/Makefile @@ -1,103 +1,54 @@ -################################################### -# Project definition -# -PROJECT = Zipper -TARGET = $(PROJECT) -DESCRIPTION = C++ wrapper around minizip compression library -STANDARD = --std=c++11 -BUILD_TYPE = release - -################################################### -# Documentation -# -LOGO = logo.png - ################################################### # Location of the project directory and Makefiles # P := . M := $(P)/.makefile -include $(M)/Makefile.header - -################################################### -# Inform Makefile where to find *.cpp and *.o files -# -VPATH += $(P)/src $(P)/src/utils $(THIRDPART) ################################################### -# Inform Makefile where to find header files -# -INCLUDES += -I. -I$(P)/include -I$(P)/src - -################################################### -# Compilation +# Project definition # -#CXXFLAGS += -Wno-undef +include $(P)/Makefile.common +TARGET_NAME := $(PROJECT_NAME) +TARGET_DESCRIPTION := An open source implementation of the SimCity 2013 simulation engine GlassBox +include $(M)/project/Makefile ################################################### -# Project defines. +# Compile shared and static libraries # -DEFINES += -DHAVE_AES -ifeq ($(ARCHI),Windows) -DEFINES += -DUSE_WINDOWS +LIB_FILES := $(call rwildcard,src,*.cpp) +INCLUDES := $(P)/include $(P)/src $(P) +VPATH := $(P)/src $(P)/src/utils $(THIRDPART_DIR) +ifeq ($(OS),Windows) + LIB_FILES += src/utils/dirent.c + DEFINES += -DUSE_WINDOWS -DHAVE_AES else -DEFINES += -UUSE_WINDOWS + DEFINES += -UUSE_WINDOWS -DHAVE_AES endif +THIRDPART_LIBS := $(abspath $(THIRDPART_DIR)/minizip/build/libminizip.a) +THIRDPART_LIBS += $(abspath $(THIRDPART_DIR)/minizip/build/libaes.a) +THIRDPART_LIBS += $(abspath $(THIRDPART_DIR)/zlib-ng/build/libz.a) ################################################### -# Compiled files +# Documentation # -ifeq ($(ARCHI),Windows) -LIB_OBJS += dirent.o -endif -LIB_OBJS += Timestamp.o Path.o Zipper.o Unzipper.o +PATH_PROJECT_LOGO := $(PROJECT_DOC_DIR)/doxygen-logo.png ################################################### -# Libraries. +# Generic Makefile rules # -PKG_LIBS += -LINKER_FLAGS += -THIRDPART_LIBS += \ - $(abspath $(THIRDPART)/minizip/build/libminizip.a) \ - $(abspath $(THIRDPART)/minizip/build/libaes.a) \ - $(abspath $(THIRDPART)/zlib-ng/build/libz.a) +include $(M)/rules/Makefile ################################################### -# Compile static and shared libraries -all: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE) +# Extra rules +# +all:: demos -################################################### -# Compile the demo as standalone application. .PHONY: demos -demos: | $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) - @$(call print-from,"Compiling demos",$(PROJECT),unzip) - $(MAKE) -C doc/demos/Unzipper all +demos: + $(Q)$(MAKE) --no-print-directory --directory=doc/demos/Unzipper all -################################################### -# Compile and launch unit tests and generate the code coverage html report. -.PHONY: unit-tests -.PHONY: check -unit-tests check: - @$(call print-simple,"Compiling unit tests") - @$(MAKE) -C tests coverage - -################################################### -# Install project. You need to be root. -.PHONY: install -install: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE) - @$(call INSTALL_DOCUMENTATION) - @$(call INSTALL_PROJECT_LIBRARIES) - @$(call INSTALL_PROJECT_HEADERS) +clean:: + $(Q)$(MAKE) --no-print-directory --directory=doc/demos/Unzipper clean -################################################### -# Clean the whole project. -.PHONY: veryclean -veryclean: clean - @rm -fr cov-int $(PROJECT).tgz *.log foo 2> /dev/null - @(cd tests && $(MAKE) -s clean) - @$(call print-simple,"Cleaning","$(THIRDPART)") - @rm -fr $(THIRDPART)/*/ doc/html 2> /dev/null - -################################################### -# Sharable informations between all Makefiles -include $(M)/Makefile.footer +install:: + $(Q)$(MAKE) --no-print-directory --directory=doc/demos/Unzipper install \ No newline at end of file diff --git a/Makefile.common b/Makefile.common new file mode 100644 index 0000000..04275c7 --- /dev/null +++ b/Makefile.common @@ -0,0 +1,4 @@ +PROJECT_NAME := zipper +PROJECT_VERSION := 2.1.0 +COMPILATION_MODE := release +CXX_STANDARD := --std=c++14 \ No newline at end of file diff --git a/README.md b/README.md index c22307d..a7c46b4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Zipper](doc/logo.png) -[Zipper](https://github.com/lecrapouille/zipper) is a C++11 wrapper around minizip compression library. Its goal is to bring the power and simplicity of minizip to a more object-oriented/c++ user-friendly library. +[Zipper](https://github.com/lecrapouille/zipper) is a C++11 wrapper around minizip compression library. Its goal is to bring the power and simplicity of minizip to a more object-oriented/c++ user-friendly library. Note: We are currently using C++14 because the unit tests library needs it. This project is the continuation of the original [project](https://github.com/sebastiandev/zipper/tree/v2.x.y). The original project was born out of the necessity of a compression library that would be reliable, simple, and flexible. By flexibility I mean supporting all kinds of inputs and outputs, but specifically being able to compress into memory instead of being restricted to file compression only, and using data from memory instead of just files as well. diff --git a/VERSION.txt b/VERSION.txt deleted file mode 100644 index 7ec1d6d..0000000 --- a/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -2.1.0 diff --git a/doc/demos/Unzipper/Makefile b/doc/demos/Unzipper/Makefile index 2c95efc..2296815 100644 --- a/doc/demos/Unzipper/Makefile +++ b/doc/demos/Unzipper/Makefile @@ -1,53 +1,26 @@ -################################################### -# Project definition -# -PROJECT = Zipper -TARGET = demo_unzip -DESCRIPTION = Demo for unzipping a zip -STANDARD = --std=c++11 -BUILD_TYPE = release - ################################################### # Location of the project directory and Makefiles # P := ../../.. M := $(P)/.makefile -include $(M)/Makefile.header - -################################################### -# Inform Makefile where to find *.cpp and *.o files -# -VPATH += $(P) src - -################################################### -# Inform Makefile where to find header files -# -INCLUDES += -I$(P)/include -Isrc ################################################### -# Compilation -# -CXXFLAGS += - -################################################### -# Project defines. +# Project definition # -DEFINES += +include $(P)/Makefile.common +TARGET_NAME := unzipper-demo +TARGET_DESCRIPTION := A demo for unzipping using $(PROJECT_NAME) +include $(M)/project/Makefile ################################################### -# Compile the demo as standalone application. +# Compile the standalone application # -OBJS += demo_unzip.o +SRC_FILES := $(call rwildcard,src,*.cpp) +INCLUDES := $(P)/include src +VPATH := $(P)/demo +INTERNAL_LIBS := $(call internal-lib,$(PROJECT_NAME)) ################################################### -# Libraries: link against our newly compiled lib +# Generic Makefile rules # -THIRDPART_LIBS += $(abspath $(P)/$(BUILD)/libzipper.a) - -################################################### -# Compile static and shared libraries -all: $(TARGET) - -################################################### -# Sharable informations between all Makefiles -include $(M)/Makefile.footer +include $(M)/rules/Makefile diff --git a/doc/doxygen-logo.png b/doc/doxygen-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..5ed3982654056f456bf0f42c2b0f7d927c3c6ba1 GIT binary patch literal 8679 zcmeHLc{G&m`+t-um5eB9(ljVxW(;GSW=MwYdzJ{ZVQga=45B0%TlSQ#vLuztRb6?B-JW(b_$G7u|@&N#_ zT~~)-2L4jOkNRdF@O#&74@dB)G04K2VMYvqdHK+tXzo-PBhZTqqcUku0Kk0XVbZt# zk=*8G=je-$V#QM`dAfO?&!=KM%-Dv;AL`Gx179XzamDi-8=2lc1J+zdb@!J^9DxPOtuhu2Z{?DW1Qq z&81l{Ygu^muFRd_^y`nVC4R!qjh|W$>ie)N*V*3ku+1GSIlNVd^hx*tx7>LVxO{1>jqcO>hqV)hX`hh| zrOQh{?yydli3kWpB|nq%_~7?p)Ua=`+89a|wvkjjB&Ixi?s2@G6)u!x=WjE3#Z)0J zOZ=i>%txeU<>eCwam;9yyRO)eTLa@ywA*HupUf(seBvO2{M@Qj9pyRi@B%D(JzJEEp=tO$v*QCb7*XG&YYT9AX zkyx&i|D_y^ zIwlQ_E^9*rESc_sBvR-kDw65p1%@2};MAF3M6w%|0V7eJX`XoaWK|s;Mx)^2R*Hsl zhF+Rf7n)9x57j)#$buZ?MpmW3)z$cLOe_fCL1hqOOb>T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UZ($ t4cA}y@4Tx+EZx3U2OcFc9JadATv18ozT?|7-~$^#SIdZS_n70k{{f_Ky+r^3 literal 0 HcmV?d00001 diff --git a/external/compile-external-libs.sh b/external/compile-external-libs.sh index 65d33a7..d0805e0 100755 --- a/external/compile-external-libs.sh +++ b/external/compile-external-libs.sh @@ -21,8 +21,6 @@ ### find them when you'll start your application. ############################################################################### -source ../.makefile/compile-external-libs.sh - ### Library zlib-ng print-compile zlib-ng if [ -e zlib-ng ]; diff --git a/external/download-external-libs.sh b/external/download-external-libs.sh index bb2c168..ef363b0 100755 --- a/external/download-external-libs.sh +++ b/external/download-external-libs.sh @@ -5,8 +5,6 @@ ### It replaces git submodules that I dislike. ############################################################################### -source ../.makefile/download-external-libs.sh - ### zlib replacement with optimizations for "next generation" systems. ### License: zlib cloning zlib-ng/zlib-ng diff --git a/tests/Makefile b/tests/Makefile index d9e8bea..0779a3f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,78 +1,39 @@ -################################################### -# Project definition -# -PROJECT = Zipper -TARGET = $(PROJECT)-UnitTest -DESCRIPTION = Unit tests for $(PROJECT) -BUILD_TYPE = debug -USE_COVERAGE = 1 - ################################################### # Location of the project directory and Makefiles # P := .. M := $(P)/.makefile -include $(M)/Makefile.header - -################################################### -# Inform Makefile where to find *.cpp and *.o files -# -VPATH += $(P) $(P)/src $(P)/src/utils ################################################### -# Inform Makefile where to find header files +# Project definition # -INCLUDES += -I$(P) -I$(P)/include -I$(P)/src +include $(P)/Makefile.common +TARGET_NAME := $(PROJECT_NAME)-tests +TARGET_DESCRIPTION := Unit tests for $(PROJECT_NAME) +COMPILATION_MODE := test +include $(M)/project/Makefile ################################################### -# Project defines. +# Compile the unit tests # +SRC_FILES := $(call rwildcard,$(P)/src,*.cpp) +SRC_FILES += $(call rwildcard,$(P)/tests,*.cpp) +INCLUDES := $(P) $(P)/include $(P)/src +VPATH := $(P) $(P)/src $(P)/src/utils DEFINES += -DPWD=\"$(shell pwd)\" DEFINES += -DHAVE_AES ifeq ($(ARCHI),Windows) -DEFINES += -DUSE_WINDOWS + LIB_FILES += $(P)/src/utils/dirent.c + DEFINES += -DUSE_WINDOWS else -DEFINES += -UUSE_WINDOWS -endif - -################################################### -# Compiled files. Note: cannot use libzipper.a as -# THIRDPART_LIBS becasue else lcov is not showing -# c++ code. -# -ifeq ($(ARCHI),Windows) -OBJS += dirent.o + DEFINES += -UUSE_WINDOWS endif -OBJS += Timestamp.o Path.o Zipper.o Unzipper.o -OBJS += TestPath.o TestZip.o -OBJS += main.o - -################################################### -# Library to test. -# -# THIRDPART_LIBS += $(abspath $(P)/build/libzipper.a.$(shell cat $(P)/VERSION.txt)) -THIRDPART_LIBS += \ - $(abspath $(THIRDPART)/minizip/build/libminizip.a) \ - $(abspath $(THIRDPART)/minizip/build/libaes.a) \ - $(abspath $(THIRDPART)/zlib-ng/build/libz.a) - -################################################### -# Libraries. -# +THIRDPART_LIBS := $(abspath $(THIRDPART_DIR)/minizip/build/libminizip.a) +THIRDPART_LIBS += $(abspath $(THIRDPART_DIR)/minizip/build/libaes.a) +THIRDPART_LIBS += $(abspath $(THIRDPART_DIR)/zlib-ng/build/libz.a) PKG_LIBS += gtest gmock ################################################### -# Compile unit tests -all: $(TARGET) - -################################################### -# Run unit tests (better to call: make coverage) -.PHONY: unit-tests -.PHONY: check -unit-tests check: $(TARGET) - @$(call print-to,"Running","$(TARGET)","$(RAPPORT)","") - $(SANITIZER) ./$(BUILD)/$(TARGET) || (cat $(TARGET).log; return 1) - -################################################### -# Sharable informations between all Makefiles -include $(M)/Makefile.footer +# Generic Makefile rules +# +include $(M)/rules/Makefile \ No newline at end of file diff --git a/tests/TestZip.cpp b/tests/TestZip.cpp index bcb1a4a..fe02dc3 100644 --- a/tests/TestZip.cpp +++ b/tests/TestZip.cpp @@ -215,11 +215,11 @@ TEST(FileUnzipTests, UnzipperPathologicalOpenings) } // Opening a non zip file - ASSERT_EQ(Path::exist("./build/Zipper-UnitTest"), true); - ASSERT_EQ(Path::isFile("./build/Zipper-UnitTest"), true); + ASSERT_EQ(Path::exist("../build/zipper-tests"), true); + ASSERT_EQ(Path::isFile("../build/zipper-tests"), true); try { - Unzipper unzipper("./build/Zipper-UnitTest"); + Unzipper unzipper("../build/zipper-tests"); } catch (std::runtime_error const& e) {