forked from Lecrapouille/zipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (83 loc) · 2.53 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
###################################################
# 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
#
#CXXFLAGS += -Wno-undef
###################################################
# Project defines.
#
DEFINES += -DHAVE_AES
ifeq ($(ARCHI),Windows)
DEFINES += -DUSE_WINDOWS
else
DEFINES += -UUSE_WINDOWS
endif
###################################################
# Compiled files
#
ifeq ($(ARCHI),Windows)
LIB_OBJS += dirent.o
endif
LIB_OBJS += Timestamp.o Path.o Zipper.o Unzipper.o
###################################################
# Libraries.
#
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)
###################################################
# Compile static and shared libraries
all: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE)
###################################################
# 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 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