-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.33 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
#
# Assumes GNU Make and on Windows assumes standard 'cmd.exe' shell
MACICONS := darwin/Contents/Resources/ftpsync.icns
PLIST := darwin/Contents/info.plist
WIX := "C:\Program Files (x86)\WIX Toolset v3.11\bin"
GO_FILES := main.go $(wildcard app/*.go)
RESOURCES := $(wildcard res/images/*.png) res/help.html resources.qrc
CLEAN := $(strip $(wildcard moc*.*) $(wildcard rcc*.*) $(wildcard ftpsync.wix*))
ifeq ($(OS),Windows_NT)
PLATFORM := windows
EXE := deploy/windows/ftpsync.exe
RM := del
else
PLATFORM := $(shell uname | tr A-Z a-z)
RM := rm
ifeq ($(PLATFORM),darwin)
EXE := deploy/darwin/ftpsync.app/Contents/MacOS/ftpsync
else
EXE := deploy/$(PLATFORM)/ftpsync
endif
endif
default: $(PLATFORM)
darwin: $(MACICONS) $(PLIST) $(EXE)
rm -f darwin/Contents/Resources/Qml/*
windows: ftpsync.syso $(EXE) ftpsync.msi
$(EXE): $(GO_FILES) $(RESOURCES)
qtdeploy build desktop
$(MACICONS): res/ftpsync.iconset/*
mkdir -p darwin/Contents/Resources
iconutil --convert icns res/ftpsync.iconset -o $@
$(PLIST): res/info.plist
cp $< $@
ftpsync.syso: res/ftpsync.exe.manifest res/ftpsync.ico
rsrc -o $@ -arch amd64 -manifest res/ftpsync.exe.manifest -ico res/ftpsync.ico
ftpsync.msi: res/ftpsync.wxs $(EXE)
$(WIX)\candle -arch x64 res/ftpsync.wxs
$(WIX)\light -ext WixUIExtension ftpsync.wixobj
clean: $(CLEAN)
ifneq ($(CLEAN),)
$(RM) $(CLEAN)
endif