forked from ekisu/mpv-webm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.55 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
# The order of the sources does matter.
LUASOURCES := src/requires.lua
LUASOURCES += src/options.lua
LUASOURCES += src/base64.lua
SOURCES += src/util.moon
SOURCES += src/video_to_screen.moon
SOURCES += src/vp8_twopass_log_patcher.moon
SOURCES += src/formats/base.moon
SOURCES += src/formats/rawvideo.moon
SOURCES += src/formats/webm.moon
SOURCES += src/formats/mp4.moon
SOURCES += src/formats/mp3.moon
SOURCES += src/formats/gif.moon
SOURCES += src/Page.moon
SOURCES += src/EncodeWithProgress.moon
SOURCES += src/encode.moon
SOURCES += src/CropPage.moon
SOURCES += src/EncodeOptionsPage.moon
SOURCES += src/PreviewPage.moon
SOURCES += src/MainPage.moon
SOURCES += src/main.moon
TMPDIR := build
JOINEDSRC := $(TMPDIR)/webm_bundle.moon
OUTPUT := $(JOINEDSRC:.moon=.lua)
JOINEDLUASRC := $(TMPDIR)/webm.lua
RESULTS := $(addprefix $(TMPDIR)/, $(SOURCES:.moon=.lua))
MPVCONFIGDIR := ~/.config/mpv/
.PHONY: all clean
all: $(JOINEDLUASRC)
$(OUTPUT): $(JOINEDSRC)
@printf 'Building %s\n' $@
@moonc -o $@ $<
$(JOINEDSRC): $(SOURCES) | $(TMPDIR)
@printf 'Generating %s\n' $@
@cat $^ > $@
$(JOINEDLUASRC): $(LUASOURCES) $(OUTPUT) | $(TMPDIR)
@printf 'Joining with Lua sources into %s.\n' $@
@cat $^ > $@
$(TMPDIR)/%.lua: %.moon
@printf 'Building %s\n' $@
@moonc -o $@ $< 2>/dev/null
$(TMPDIR):
@mkdir -p $@
$(TMPDIR)/%/: | $(TMPDIR)
@mkdir -p $@
install: $(JOINEDLUASRC)
install -d $(MPVCONFIGDIR)/scripts/
install -m 644 $(JOINEDLUASRC) $(MPVCONFIGDIR)/scripts/
clean:
@rm -rf $(TMPDIR)