forked from zlib-ng/minizip-ng
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
37 lines (28 loc) · 912 Bytes
/
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
CC=cc
CFLAGS=-O -I../.. -DHAVE_AES
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a libaes.a
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a libaes.a
TEST_FILES = test.zip readme.old readme.txt
.c.o:
$(CC) -c $(CFLAGS) $*.c
all: miniunz minizip
libaes.a:
cd aes; $(MAKE) $(MFLAGS)
miniunz: $(UNZ_OBJS) libaes.a
$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
minizip: $(ZIP_OBJS) libaes.a
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
.PHONY: test clean
test: miniunz minizip
@rm -f $(TEST_FILES)
@cp README.md readme.txt
@touch -t 200712301223.44 readme.txt
./minizip test.zip readme.txt
./miniunz -l test.zip
mv readme.txt readme.old
./miniunz test.zip
@diff -q README.md readme.txt || echo "Test failed: files differ"
@[[ "$$(stat -c %Y readme.txt)" = "$$(stat -c %Y readme.old)" ]] || echo "Test failed: timestamp not preserved"
@rm -f $(TEST_FILES)
clean:
/bin/rm -f *.o *~ minizip miniunz $(TEST_FILES)