-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
35 lines (27 loc) · 934 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
UNAME := $(shell uname)
PYINSTALLER = venv/bin/pyinstaller
PLIST_BUDDY = /usr/libexec/PlistBuddy -c
TARGET_APP = dist/VLC\ Scheduler.app
TARGET_BIN = dist/vlcscheduler
VERSION := `cd src && python -c "import version as v; print(v.VERSION)"`
INFO_PLIST := $(TARGET_APP)/Contents/Info.plist
all:
ifeq ($(UNAME), Linux)
@make $(TARGET_BIN)
endif
ifeq ($(UNAME), Darwin)
@make $(TARGET_APP)
endif
$(TARGET_APP): $(TARGET_BIN)
rm -rf $(TARGET_APP)
mkdir -p $(TARGET_APP)/Contents/{MacOS,Resources}/
cp $(TARGET_BIN) $(TARGET_APP)/Contents/MacOS
cp res/mac/Info.plist $(INFO_PLIST)
cp res/mac/launcher.sh $(TARGET_APP)/Contents/MacOS/
cp res/mac/Icon.icns $(TARGET_APP)/Contents/Resources/
$(PLIST_BUDDY) "Add CFBundleVersion String $(VERSION)" $(INFO_PLIST)
$(TARGET_BIN): src/
$(PYINSTALLER) --clean --onefile src/vlcscheduler.py
clean:
rm -rf 'vlcscheduler.spec' 'build' $(TARGET_BIN) $(TARGET_APP)
.PHONY: all clean