forked from cisco/thor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (64 loc) · 1.64 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
ENCODER_PROGRAM = build/Thorenc
DECODER_PROGRAM = build/Thordec
CFLAGS += -std=c99 -g -O6 -Wall -pedantic -I common
LDFLAGS = -lm
ifeq ($(ARCH),neon)
CFLAGS += -mfpu=neon
endif
ifeq ($(ARCH),ssse3)
CFLAGS += -mssse3
endif
ifeq ($(ARCH),sse4)
CFLAGS += -msse4
endif
COMMON_SOURCES = \
common/common_block.c \
common/common_frame.c \
common/transform.c \
common/intra_prediction.c \
common/inter_prediction.c \
common/common_kernels.c \
common/snr.c \
common/simd.c
ENCODER_SOURCES = \
enc/encode_block.c \
enc/encode_frame.c \
enc/mainenc.c \
enc/putbits.c \
enc/putvlc.c \
enc/strings.c \
enc/write_bits.c \
enc/enc_kernels.c \
$(COMMON_SOURCES)
DECODER_SOURCES = \
dec/decode_block.c \
dec/getbits.c \
dec/getvlc.c \
dec/maindec.c \
dec/read_bits.c \
dec/decode_frame.c \
$(COMMON_SOURCES)
ENCODER_OBJECTS = $(ENCODER_SOURCES:.c=.o)
DECODER_OBJECTS = $(DECODER_SOURCES:.c=.o)
OBJS = $(ENCODER_OBJECTS) $(DECODER_OBJECTS)
DEPS = $(OBJS:.o=.d)
.PHONY = clean
all: $(ENCODER_PROGRAM) $(DECODER_PROGRAM)
$(ENCODER_PROGRAM): $(ENCODER_OBJECTS)
$(CC) -o $@ $(ENCODER_OBJECTS) $(LDFLAGS)
$(DECODER_PROGRAM): $(DECODER_OBJECTS)
$(CC) -o $@ $(DECODER_OBJECTS) $(LDFLAGS)
# Build object files. In addition, track header dependencies.
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
@$(CC) -MM $(CFLAGS) $*.c > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
@rm -f $*.d.tmp
clean:
rm -f $(ENCODER_OBJECTS) $(DECODER_OBJECTS) $(DEPS)
cleanall: clean
rm -f $(ENCODER_PROGRAM) $(DECODER_PROGRAM)
-include $(DEPS)