Makefile 1.26 KB
Newer Older
1
CC = gcc
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
2
#CFLAGS = -g -Wall -DPROFILE
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
3
CFLAGS = -g -Wall
4

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
5
OBJS = aee.o aed.o sz_compat.o
6

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
7
.PHONY : all clean test test_sz
8

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
9
all: libae.a
10

11 12 13 14 15 16
test_encode: test_encode.o libae.a
	$(CC) $(CFLAGS) -o test_encode test_encode.o -L. -lae

test_decode: test_decode.o libae.a
	$(CC) $(CFLAGS) -o test_decode test_decode.o -L. -lae

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
17 18 19
test_szcomp: test_szcomp.o libae.a
	$(CC) $(CFLAGS) -o test_szcomp test_szcomp.o -L. -lae

20 21 22
libae.a: $(OBJS)
	$(AR) $(ARFLAGS) $@ $(OBJS)
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
23

24 25 26
aed.o: libae.h
aee.o: libae.h

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
27 28 29 30 31
install: libae.a
	ln -sfT ../src/szlib.h ../include/szlib.h
	ln -sfT ../src/libae.h ../include/libae.h
	ln -sfT ../src/libae.a ../lib/libsz.a

32 33 34
clean:
	rm -f $(OBJS) test_encode.o test_decode.o \
	test_encode test_decode libae.a \
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
35
	test_szcomp test_szcomp.o \
36
	../data/test.ae ../data/test
37

38 39 40 41
test: test_encode test_decode
	./test_encode 1 1 < ../data/example_data > ../data/test.ae
	./test_decode 1 1 < ../data/test.ae > ../data/test
	diff ../data/test ../data/example_data
42 43 44
	./test_encode 99 99 < ../data/example_data > ../data/test.ae
	./test_decode 101 101 < ../data/test.ae > ../data/test
	diff ../data/test ../data/example_data
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
45 46 47 48 49

test_sz: test_szcomp
	 ./test_szcomp 65536 < ../data/example_data_16 > ../data/test
	 diff ../data/test ../data/example_data_16