Makefile 1.46 KB
Newer Older
1
CC = gcc
2
#CFLAGS = -g -pg -lc -O2 -Wall -fprofile-arcs -ftest-coverage -DPROFILE
3
#CFLAGS = -g -pg -lc -O2 -Wall -fprofile-arcs -ftest-coverage -DUNROLL_BLOCK_8
4
CFLAGS = -g -O3 -Wall
5

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

8
.PHONY : all clean check
9

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

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

test_decode: test_decode.o libae.a
16
	$(CC) $(CFLAGS) -o $@ $< -L. -lae
17

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

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

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

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

34 35 36
clean:
	rm -f $(OBJS) test_encode.o test_decode.o \
	test_encode test_decode libae.a \
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
37
	test_szcomp test_szcomp.o \
38 39
	../data/test.ae ../data/test \
	*.gcno *.gcda *.gcov gmon.out
40

41
check: test_encode test_decode test_szcomp
42 43 44
	./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
45 46 47
	./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
48
	 ./test_szcomp 65536 < ../data/example_data_16 > ../data/test
49 50 51
	diff ../data/test ../data/example_data_16
	./test_szcomp 2097257 < ../data/zero_test > ../data/test
	diff ../data/test ../data/zero_test