forked from js2854/tsplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (34 loc) · 801 Bytes
/
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
CC=gcc
CFLAGS=-Wall -g -lm
TARGET=bin/tsplay
INCLUDE= -I./inc
SOURCE= \
src/accessunit.c \
src/bitdata.c \
src/es.c \
src/h222.c \
src/h262.c \
src/misc.c \
src/nalunit.c \
src/pes.c \
src/pidint.c \
src/ps.c \
src/reverse.c \
src/ts.c \
src/tsplay.c \
src/tswrite.c
OBJPATH=./obj
default: $(TARGET)
DEPS=$(addprefix $(OBJPATH)/, $(patsubst %.c, %.d, $(filter %.c, $(SOURCE))))
OBJS=$(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SOURCE))))
-include $(DEPS)
$(OBJPATH)/%.o : %.c
test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
$(TARGET): $(OBJS)
test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -o $@ $^
@echo -e "\n<Tips> Build '$(TARGET)' success!\n"
clean:
rm -rf $(OBJPATH) $(TARGET)
@echo -e "\n<Tips> clean complete!\n"