-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcfg.mk
240 lines (208 loc) · 6.61 KB
/
cfg.mk
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# cfg.mk -- Setup maintainer's makefile.
# Copyright (C) 2015-2018 PUC-Rio/Laboratorio TeleMidia
#
# This file is part of LibPlay.
#
# LibPlay is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibPlay is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibPlay. If not, see <http://www.gnu.org/licenses/>.
COPYRIGHT_YEAR= 2016
COPYRIGHT_HOLDER= PUC-Rio/Laboratorio TeleMidia
INDENT_OPTIONS=\
$(NULL)
INDENT_EXCLUDE=\
$(NULL)
INDENT_JOIN_EMPTY_LINES_EXCLUDE=\
$(NULL)
INDENT_TYPES=\
$(NULL)
SC_USELESS_IF_BEFORE_FREE_ALIASES=\
g_free\
$(NULL)
SYNTAX_CHECK_EXCLUDE=\
$(NULL)
SC_COPYRIGHT_EXCLUDE=\
$(REMOTE_FILES)\
play/luax-macros.h\
$(NULL)
UPDATE_COPYRIGHT_EXCLUDE=\
$(NULL)
SC_RULES+= sc-copyright
sc-copyright:
$(V_at)$(build_aux)/syntax-check-copyright\
-b='/*' -e='*/' -t=cfg.mk\
$(call vc_list_exclude, $(VC_LIST_C), $(SC_COPYRIGHT_EXCLUDE))
$(V_at)$(build_aux)/syntax-check-copyright\
-b='#' -t=cfg.mk\
$(call vc_list_exclude,\
$(VC_LIST_AC)\
$(VC_LIST_AM)\
$(VC_LIST_MK)\
$(VC_LIST_PL)\
$(VC_LIST_SH),\
$(SC_COPYRIGHT_EXCLUDE))
# Files copied from the NCLua project.
nclua:= https://github.com/gflima/nclua/raw/master
NCLUA_FILES+= build-aux/Makefile.am.common
NCLUA_FILES+= build-aux/Makefile.am.coverage
NCLUA_FILES+= build-aux/Makefile.am.env
NCLUA_FILES+= build-aux/Makefile.am.gitlog
NCLUA_FILES+= build-aux/Makefile.am.link
NCLUA_FILES+= build-aux/Makefile.am.valgrind
NCLUA_FILES+= build-aux/util.m4
NCLUA_FILES+= lib/luax-macros.h
NCLUA_FILES+= lib/macros.h
NCLUA_FILES+= maint.mk
NCLUA_FILES+= tests/lua.c
NCLUA_SCRIPTS+= build-aux/syntax-check
NCLUA_SCRIPTS+= build-aux/syntax-check-copyright
REMOTE_FILES+= $(NCLUA_FILES)
REMOTE_SCRIPTS+= $(NCLUA_SCRIPTS)
.PHONY: fetch-remote-local-nclua
fetch-remote-local-nclua:
$(V_at)for path in $(NCLUA_FILES) $(NCLUA_SCRIPTS); do\
if test "$$path" = "lib/luax-macros.h"; then\
dir=play;\
else\
dir=`dirname "$$path"`;\
fi;\
$(FETCH) -dir="$$dir" "$(nclua)/$$path" || exit 1;\
done
glib:= https://git.gnome.org/browse/glib/plain
REMOTE_SCRIPTS+= bootstrap
.PHONY: fetch-remote-local-glib
fetch-remote-local-glib: fetch-remote-local-nclua
$(V_at)$(FETCH) -dir=. $(glib)/autogen.sh && mv autogen.sh bootstrap
fetch-remote-local: fetch-remote-local-nclua fetch-remote-local-glib
# Build dependencies locally.
glib_dir:= deps/glib
glib_git:= git://git.gnome.org/glib
glib_configure:=\
--prefix=$(PWD)/deps/tree\
--enable-debug=yes\
--enable-gc-friendly\
--disable-mem-pools\
--disable-installed-tests\
--disable-always-build-tests\
--disable-man\
--disable-compile-warnings\
CFLAGS='-O0 -g'\
$(NULL)
gstreamer_dir:= deps/gstreamer
gstreamer_git_root:= git://anongit.freedesktop.org/gstreamer
gstreamer_git:= $(gstreamer_git_root)/gstreamer
gstreamer_configure:=\
--prefix=$(PWD)/deps/tree\
--disable-fatal-warnings\
--disable-examples\
--disable-tests\
--disable-failing-tests\
--disable-benchmarks\
--disable-docbook\
--disable-gtk-doc\
--disable-check\
--with-pkg-config-path=$(PWD)/deps/tree/lib/pkgconfig\
$(NULL)
gstreamer_build:=\
CFLAGS='-O0 -g'\
$(NULL)
gstbase_dir:= deps/gstbase
gstbase_git:= $(gstreamer_git_root)/gst-plugins-base
gstbase_configure= $(gstreamer_configure)
gstbase_build= $(gstreamer_build)
gstgood_dir:= deps/gstgood
gstgood_git:= $(gstreamer_git_root)/gst-plugins-good
gstgood_configure= $(gstreamer_configure)
gstgood_build= $(gstreamer_build)
gstbad_dir:= deps/gstbad
gstbad_git:= $(gstreamer_git_root)/gst-plugins-bad
gstbad_configure= $(gstreamer_configure)
gstbad_build= $(gstreamer_build)
gstugly_dir:= deps/gstugly
gstugly_git:= $(gstreamer_git_root)/gst-plugins-ugly
gstugly_configure= $(gstreamer_configure)
gstugly_build= $(gstreamer_build)
gstffmpeg_dir:= deps/gstffmpeg
gstffmpeg_git:= $(gstreamer_git_root)/gst-ffmpeg
gstffmpeg_configure= $(gstreamer_configure)
gstffmpeg_build= $(gstreamer_build)
DEPS= glib gstreamer gstbase gstgood gstbad gstugly gstffmpeg
# Bootstraps project with local deps.
.PHONY: deps-bootstrap
deps-bootstrap:
$(V_at)./$(BOOTSTRAP)
$(V_at)./configure $(bootstrap_default_options) $(BOOTSTRAP_EXTRA)\
PKG_CONFIG_PATH=$(PWD)/deps/tree/lib/pkgconfig
# Syncs (cloning, if necessary) local deps.
.PHONY: deps-sync
deps-sync: $(foreach dep,$(DEPS),deps-sync-$(dep))
find . -name '*.[ch]' -print0 | xargs -0 etags
define deps_sync_tpl=
.PHONY: deps-sync-$(1)
deps-sync-$(1):
test -d $(2) || git clone $(3) $(2)
(cd $(2) && git pull) || exit 1
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_sync_tpl,$(dep),$($(dep)_dir),$($(dep)_git))))
# Configures (forcefully) local deps.
.PHONY: deps-force-configure
deps-force-configure: $(foreach dep,$(DEPS),deps-force-configure-$(dep))
$(GLIB_CONFIGURE)
$(GSTREAMER_CONFIGURE)
define deps_force_configure_tpl=
.PHONY: deps-force-configure-$(1)
deps-force-configure-$(1):
cd $(2) && ./autogen.sh $(3)
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_force_configure_tpl,$(dep),$($(dep)_dir),$($(dep)_configure))))
# Configures local deps.
.PHONY: deps-configure
deps-configure: $(foreach dep,$(DEPS),deps-configure-$(dep))
define deps_configure_tpl=
.PHONY: deps-configure-$(1)
deps-configure-$(1):
test -f $(2)/configure || (cd $(2) && ./autogen.sh $(3))
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_configure_tpl,$(dep),$($(dep)_dir),$($(dep)_configure))))
# Builds local deps.
.PHONY: deps-build
deps-build: $(foreach dep,$(DEPS),deps-build-$(dep))
define deps_build_tpl=
.PHONY: deps-build-$(1)
deps-build-$(1): deps-configure-$(1)
$(MAKE) -C $(2) $(3)
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_build_tpl,$(dep),$($(dep)_dir),$($(dep)_build))))
# Cleans local deps.
.PHONY: deps-clean
deps-clean: $(foreach dep,$(DEPS),deps-clean-$(dep))
define deps_clean_tpl=
.PHONY: deps-clean-$(1)
deps-clean-$(1):
$(MAKE) -C $(2) $(3) clean
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_clean_tpl,$(dep),$($(dep)_dir),$($(dep)_clean))))
# Installs local deps.
.PHONY: deps-install
deps-install: $(foreach dep,$(DEPS),deps-install-$(dep))
define deps_install_tpl=
.PHONY: deps-install-$(1)
deps-install-$(1): deps-configure-$(1)
$(MAKE) -C $(2) $(3) install
endef
$(foreach dep,$(DEPS),\
$(eval $(call deps_install_tpl,$(dep),$($(dep)_dir),$($(dep)_install))))