forked from linuxstb/pidvbip
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
119 lines (90 loc) · 1.75 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# Makefile for pidvbip
#
DIR := $(dir $(lastword $(MAKEFILE_LIST)))
-include $(DIR)/.config.mk
ROOTDIR ?= $(DIR)
BUILDDIR ?= $(ROOTDIR)/build.linux
#
# Compiler
#
CFLAGS += -I$(BUILDDIR)
vpath %.c $(ROOTDIR)
vpath %.h $(ROOTDIR)
#
# Debug/Output
#
ifdef P
ECHO = printf "%-16s%s\n" $(1) $(2)
BRIEF = CC MKBUNDLE CXX
MSG = $(subst $(BUILDDIR)/,,$@)
$(foreach VAR,$(BRIEF), \
$(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
endif
#
# Core
#
SRCS = \
sha1.c \
acodec_omx.c \
cec.c \
channels.c \
codec.c \
events.c \
htsp.c \
input.c \
configfile.c \
msgqueue.c \
pidvbip.c \
omx_utils.c \
osd.c \
snapshot.c \
tiresias_pcfont.c \
utils.c \
vcodec_omx.c \
vo_pi.c
BIN = $(ROOTDIR)/pidvbip
LIBVGFONT = $(ROOTDIR)/libs/vgfont/libvgfont.a
#
# Optional
#
SRCS-$(CONFIG_AVAHI) += avahi.c
SRCS-$(CONFIG_LIBAVFORMAT) += avplay.c
#
# Build variables
#
SRCS += $(SRCS-yes)
OBJS = $(SRCS:%.c=$(BUILDDIR)/%.o)
DEPS = ${OBJS:%.o=%.d}
#
# Phony Targets
.PHONY: default all clean distclean check_config reconfigure
default: $(BIN)
all: default $(FLVTOH264)
clean:
@$(RM) $(BIN) $(BUILDDIR)/*.[odc] $(FLVTOH264)
make -C $(ROOTDIR)/libs/vgfont clean
distclean: clean
@$(RM) -r $(BUILDDIR) .config.mk
check_config:
@test $(ROOTDIR)/.config.mk -nt $(ROOTDIR)/configure \
|| echo "./configure output is old, please re-run"
@test $(ROOTDIR)/.config.mk -nt $(ROOTDIR)/configure
reconfigure:
$(ROOTDIR)/configure $(CONFIGURE_ARGS)
#
# Build Targets
#
$(BIN): check_config $(LIBVGFONT) $(OBJS)
$(CC) -o $@ $(OBJS) $(LIBVGFONT) $(LDFLAGS)
#
# Build Intermediates
#
$(LIBVGFONT):
make -C libs/vgfont/ INCLUDES='$(CFLAGS)'
${BUILDDIR}/%.o: %.c
$(CC) -MD -MP $(CFLAGS) -c -o $@ $<
#
# Depdencies
#
-include $(DEPS)