| 1 | CC=cc |
| 2 | CFLAGS := $(CFLAGS) -O -I../.. |
| 3 | |
| 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a |
| 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a |
| 6 | |
| 7 | .c.o: |
| 8 | $(CC) -c $(CFLAGS) $*.c |
| 9 | |
| 10 | all: miniunz minizip |
| 11 | |
| 12 | miniunz: $(UNZ_OBJS) |
| 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) |
| 14 | |
| 15 | minizip: $(ZIP_OBJS) |
| 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) |
| 17 | |
| 18 | test: miniunz minizip |
| 19 | @rm -f test.* |
| 20 | @echo hello hello hello > test.txt |
| 21 | ./minizip test test.txt |
| 22 | ./miniunz -l test.zip |
| 23 | @mv test.txt test.old |
| 24 | ./miniunz test.zip |
| 25 | @cmp test.txt test.old |
| 26 | @rm -f test.* |
| 27 | |
| 28 | clean: |
| 29 | /bin/rm -f *.o *~ minizip miniunz test.* |