forked from ctabin/libzippp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (37 loc) · 1.1 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
CC=g++
CFLAGS=-W -Wall -Wextra -ansi -pedantic
OBJ=obj
LIB=lib
LIBZIP=$(LIB)/libzip-0.11.2
all: libzippp-static libzippp-shared
libzippp-compile:
rm -rf $(OBJ)
mkdir $(OBJ)
$(CC) -fPIC -c -I$(LIBZIP)/lib -o $(OBJ)/libzippp.o $(CFLAGS) src/libzippp.cpp
libzippp-static: libzippp-compile
ar rvs libzippp.a $(OBJ)/libzippp.o
libzippp-shared: libzippp-compile
$(CC) -shared -o libzippp.so $(OBJ)/libzippp.o
libzippp-tests: libzippp-static
$(CC) -o test -I$(LIBZIP)/lib -Isrc $(CFLAGS) tests/tests.cpp libzippp.a $(LIBZIP)/lib/.libs/libzip.a -lz
clean-tests:
@rm -rf *.zip
tests: libzippp-tests clean-tests
valgrind --suppressions=ld.supp ./test
clean:
@rm -rf libzippp.a libzippp.so
@rm -rf $(OBJ)
@rm -rf test
mrproper: clean
@rm -rf $(LIB)
libzip-init:
mkdir -p $(LIB)
libzip-download: libzip-init
wget -c -O "$(LIB)/libzip-0.11.2.tar.gz" "http://www.nih.at/libzip/libzip-0.11.2.tar.gz"
libzip-unzip: libzip-download
cd $(LIB) && tar -xf libzip-0.11.2.tar.gz
libzip-configure: libzip-unzip
cd $(LIBZIP) && ./configure
libzip-compile: libzip-configure
cd $(LIBZIP) && make
libzip: libzip-compile