-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (68 loc) · 3.72 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
PREFIX := build/deps
BASE := .
# stop talloc from dumping debug strings everywhere.
MPVCFLAGS := -DTA_NO_WRAPPERS -I$(realpath $(PREFIX))/include
MPVLDFLAGS := -L$(realpath $(PREFIX))/lib
PKG_CONFIG_PATH := $(realpath $(PREFIX))/lib/pkgconfig:/usr/local/lib/pkgconfig
LIBMPV_CONFIGURE_FLAGS := --lua=luajit --disable-cplayer --disable-vapoursynth --disable-vapoursynth-lazy --enable-libmpv-shared --disable-encoding "--prefix=$(realpath $(PREFIX))"
FFMPEG_CONFIGURE_FLAGS := --disable-static --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-videotoolbox --enable-vda --disable-programs --disable-encoders --disable-muxers --enable-lto --enable-hardcoded-tables "--prefix=$(realpath $(PREFIX))"
VIDEO_INTERFACE_DEPS := src/web-ui/scripts/fullscreenButton.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/globals.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/hoverTime.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/playButton.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/playTime.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/seekBar.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/volumeWidget.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/scripts/about.coffee
VIDEO_INTERFACE_DEPS += src/web-ui/styles/bottomBar.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/fullscreenButton.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/hoverTime.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/main.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/mixins.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/playButton.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/playTime.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/seekBar.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/volumeWidget.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/about.styl
VIDEO_INTERFACE_DEPS += src/web-ui/styles/titlebar.styl
.PHONY: all libmpv ffmpeg video-interface debug release clean
all: debug
debug:
@xctool -reporter pretty -project vpm.xcodeproj -scheme vpm -configuration Debug
# @xcodebuild -project vpm.xcodeproj -target vpm -configuration Debug
release: MPVCFLAGS += -DNDEBUG
release:
@xctool -project vpm.xcodeproj -scheme vpm -configuration Release
# @xcodebuild -project vpm.xcodeproj -target vpm -configuration Release
clean:
rm -rf build
video-interface: $(BASE)/src/web-ui/video.html
$(BASE)/src/web-ui/video.html: $(BASE)/src/web-ui/video.jade $(VIDEO_INTERFACE_DEPS)
@jade -P $<
libmpv: $(PREFIX)/lib/libmpv.dylib
$(PREFIX)/lib/libmpv.dylib: $(BASE)/deps/mpv/build/config.h
@echo waf build
@cd $(BASE)/deps/mpv && ./waf build
@echo waf install
@cd $(BASE)/deps/mpv && ./waf install
# This is kind of a mediocre dependency chain both in terms of rebuilding mpv as
# well as determining when to reconfigure mpv, but I'd rather have it not run in
# every case it should than run in cases it shouldn't. The xcode script handles
# the awkward case of switching between debug and release prefixes.
$(BASE)/deps/mpv/build/config.h: $(PREFIX)/lib/libavcodec.dylib $(BASE)/deps/mpv/waf | $(PREFIX)
@echo waf configure
@cd $(BASE)/deps/mpv && CFLAGS="$(MPVCFLAGS)" LINKFLAGS="$(MPVLDFLAGS)" ./waf configure $(LIBMPV_CONFIGURE_FLAGS) >/dev/null 2>&1
@# clear out personal filesystem details from the configuration header, since
@# they get baked into the binary.
@sed -e "s:$(realpath $(PREFIX))::g" -i .bak $@
$(BASE)/deps/mpv/waf:
@cd $(BASE)/deps/mpv && ./bootstrap.py
ffmpeg: $(PREFIX)/lib/libavcodec.dylib
$(PREFIX)/lib/libavcodec.dylib: $(BASE)/deps/FFmpeg/config.h
@echo ffmpeg build
@$(MAKE) -C $(BASE)/deps/FFmpeg install
$(BASE)/deps/FFmpeg/config.h: | $(PREFIX)
@cd $(BASE)/deps/FFmpeg && PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ./configure $(FFMPEG_CONFIGURE_FLAGS)
@sed -e "s:$(realpath $(PREFIX))::g" -i .bak $@
$(PREFIX):
@mkdir -p "$@"