summarylogtreecommitdiffstats
path: root/libr-zip.patch
blob: a8348a71dd14f8c806c5c6e394dfd56f5048da6a (plain)
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
diff --git a/zip/src/Makevars b/zip/src/Makevars
index 9bf6e3b..f622216 100644
--- a/zip/src/Makevars
+++ b/zip/src/Makevars
@@ -1,17 +1,20 @@
-
-PKG_CFLAGS = $(C_VISIBILITY)
-
-OBJECTS = init.o miniz.o rzip.o zip.o unixutils.o
+OBJECTS = init.o rzip.o
+PKG_LIBS = -L. -lr-zip
 
 .PHONY: all clean
 
 all: tools/cmdzip tools/cmdunzip $(SHLIB)
 
-tools/cmdzip: miniz.c zip.c unixutils.c tools/cmdzip.c
-	$(CC) $(CFLAGS) miniz.c zip.c unixutils.c tools/cmdzip.c -o tools/cmdzip
+tools/cmdzip: tools/cmdzip.o libr-zip.so
+	$(CC) $(LDFLAGS) -o $@ $^
 
-tools/cmdunzip: miniz.c zip.c unixutils.c tools/cmdunzip.c
-	$(CC) $(CFLAGS) miniz.c zip.c unixutils.c tools/cmdunzip.c -o tools/cmdunzip
+tools/cmdunzip: tools/cmdunzip.o libr-zip.so
+	$(CC) $(LDFLAGS) -o $@ $^
+
+$(SHLIB): libr-zip.so
+
+libr-zip.so: miniz.o zip.o unixutils.o
+	$(CC) -shared $(LDFLAGS) -o $@ $^
 
 clean:
 	rm -rf $(SHLIB) $(OBJECTS) \