Makefile 1.28 KB
Newer Older
1
CC = gcc
2
3
#CFLAGS = -g -pg -lc -O0 -Wall -fprofile-arcs -ftest-coverage
CFLAGS = -g -O3 -Wall -std=c99
4

5
OBJS = aee.o aee_mutators.o aed.o sz_compat.o
6

7
.PHONY : all clean check
8

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

11
encode: encode.o libae.a
12
	$(CC) $(CFLAGS) -o $@ $< -L. -lae
13

14
decode: decode.o libae.a
15
	$(CC) $(CFLAGS) -o $@ $< -L. -lae
16

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

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

24
aed.o: libae.h
25
26
27
aee.o: aee_mutators.h aee.h libae.h
aee_mutators.o: aee.h libae.h
sz_compat.o: libae.h
28

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

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

42
check: encode decode test_szcomp
43
44
	 ./encode -c -b1 -B8 -R128 -J64 ../data/example_data > ../data/test.aee
	 ./decode -b1 -B8 -R128 -J64 ../data/test.aee
45
	 diff ../data/test ../data/example_data
46
47
	 ./encode -c -b1024 -B8 -R128 -J64 ../data/example_data > ../data/test.aee
	 ./decode -b1024 -B8 -R128 -J64 ../data/test.aee
48
49
	 diff ../data/test ../data/example_data
	 ./test_szcomp 65536 ../data/example_data_16