Skip to content

Commit

Permalink
Use MyMakefile-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Jul 1, 2024
1 parent 16ebfeb commit a8969f8
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .makefile
Submodule .makefile updated 59 files
+0 −102 .github/workflows/ci.yml
+0 −10 .gitignore
+674 −21 LICENSE
+0 −72 Makefile.color
+0 −328 Makefile.flags
+0 −295 Makefile.footer
+0 −241 Makefile.header
+0 −24 Makefile.help
+0 −336 Makefile.macros
+2 −398 README.md
+1 −0 VERSION
+0 −1 VERSION.txt
+367 −202 assets/doxygen/Doxyfile
+0 −0 assets/doxygen/doxygen.css
+0 −0 assets/doxygen/footer.html
+1 −0 assets/doxygen/header.html
+ assets/icons/logo.png
+ assets/icons/macos.icns
+3 −3 assets/scripts/alib.sh
+23 −26 assets/scripts/compile-external-libs.sh
+18 −18 assets/scripts/config.sh
+61 −0 assets/scripts/download-external-libs.sh
+27 −17 assets/scripts/targz.sh
+91 −0 doc/API.md
+14 −0 doc/demos/00/Makefile
+1 −2 doc/demos/00/src/main.cpp
+16 −0 doc/demos/01/Makefile
+12 −0 doc/demos/01/src/foo.cpp
+1 −1 doc/demos/01/src/foo.hpp
+3 −2 doc/demos/01/src/main.cpp
+16 −0 doc/demos/01/tests/Makefile
+13 −0 doc/demos/01/tests/unit-tests.cpp
+21 −0 doc/demos/02/Makefile
+0 −0 doc/demos/02/include/bar.hpp
+0 −0 doc/demos/02/include/foo.hpp
+15 −0 doc/demos/02/src/bar/Makefile
+0 −0 doc/demos/02/src/bar/bar.cpp
+15 −0 doc/demos/02/src/foo/Makefile
+0 −0 doc/demos/02/src/foo/foo.cpp
+15 −0 doc/demos/02/src/main.cpp
+0 −75 download-external-libs.sh
+0 −18 examples/00/Makefile
+0 −1 examples/00/VERSION.txt
+0 −27 examples/01/Makefile
+0 −1 examples/01/VERSION.txt
+0 −8 examples/01/src/foo.cpp
+0 −22 examples/01/tests/Makefile
+0 −1 examples/01/tests/VERSION.txt
+0 −14 examples/01/tests/unit-tests.cpp
+0 −62 examples/02/Makefile
+0 −1 examples/02/VERSION.txt
+0 −40 examples/02/src/bar/Makefile
+0 −1 examples/02/src/bar/VERSION.txt
+0 −40 examples/02/src/foo/Makefile
+0 −1 examples/02/src/foo/VERSION.txt
+0 −8 examples/02/src/main.cpp
+0 −37 examples/README.md
+397 −0 project/Makefile
+1,173 −0 rules/Makefile
107 changes: 29 additions & 78 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 = doc/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
4 changes: 4 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PROJECT_NAME := zipper
PROJECT_VERSION := 2.1.0
COMPILATION_MODE := release
CXX_STANDARD := --std=c++11
1 change: 0 additions & 1 deletion VERSION.txt

This file was deleted.

51 changes: 12 additions & 39 deletions doc/demos/Unzipper/Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions external/compile-external-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 0 additions & 2 deletions external/download-external-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8969f8

Please sign in to comment.