-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (37 loc) · 1.16 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# Simple makefile for gcc compiler
#
EXES = fsc test bit_test div_test bit_cmp
all: libfsc.a $(EXES)
CC = gcc
CFLAGS = -O3 -DNDEBUG
AR = ar
ARFLAGS = r
LDFLAGS = -lm
%.o: %.c fsc.h divide.h
$(CC) $(CFLAGS) -c $< -o $@
%.a:
$(AR) $(ARFLAGS) $@ $^
libfscutils.a: fsc_utils.o fsc_utils.h divide.h
libfsc.a: fsc_enc.o fsc_dec.o fsc.h bits.o bits.h alias.o alias.h histo.o divide.h
test: test.o libfsc.a libfscutils.a
gcc -o test test.o ./libfsc.a ./libfscutils.a $(LDFLAGS) $(CFLAGS)
fsc: fsc.o libfsc.a libfscutils.a
gcc -o fsc fsc.o ./libfsc.a ./libfscutils.a $(LDFLAGS) $(CFLAGS)
bit_test: bit_test.o libfsc.a libfscutils.a
gcc -o bit_test bit_test.o ./libfscutils.a ./libfsc.a $(LDFLAGS) $(CFLAGS)
div_test: div_test.o libfsc.a libfscutils.a divide.h
gcc -o div_test div_test.o ./libfscutils.a ./libfsc.a $(LDFLAGS) $(CFLAGS)
bit_cmp: bit_cmp.o libfsc.a libfscutils.a
gcc -o bit_cmp bit_cmp.o ./libfscutils.a ./libfsc.a $(LDFLAGS) $(CFLAGS)
pak: clean
tar czf fsc_oss.tgz *.c *.h Makefile AUTHORS CONTRIBUTORS LICENSE README
clean:
rm -f *~ *.o *.a $(EXES)
bug: test
./test -s 2 40
./test -s 13 10000
./test -s 3 -p
bench: $(EXES)
./bit_test
./quick_check.sh