-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16ebfeb
commit bf162fd
Showing
12 changed files
with
76 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule .makefile
updated
59 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 := $(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,28 @@ | ||
################################################### | ||
# 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) | ||
include $(M)/rules/Makefile | ||
|
||
################################################### | ||
# Sharable informations between all Makefiles | ||
include $(M)/Makefile.footer | ||
$(INTERNAL_LIBS): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters