forked from Open-Wine-Components/umu-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
180 lines (134 loc) · 5.23 KB
/
Makefile.in
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
PROJECT := umu-launcher
# If this is changed to umu (uppercase), `uninstall` target will also remove the SLR directory
INSTALLDIR ?= umu
OBJDIR := builddir
PREFIX ?= /usr
BINDIR := $(PREFIX)/bin
LIBDIR := $(PREFIX)/lib
DATADIR := $(PREFIX)/share
MANDIR := $(DATADIR)/man
DESTDIR ?=
USERINSTALL ?= xfalse
FLATPAK ?= xfalse
.PHONY: all
ifeq ($(FLATPAK), xtrue)
all: version reaper umu umu-launcher
else
all: version reaper umu umu-docs umu-launcher
endif
.PHONY: install
ifeq ($(USERINSTALL), xtrue)
install: reaper-install umu-install umu-launcher-install user-install
else
install: reaper-install umu-install umu-launcher-install
endif
# Special case, do this inside the source directory for release distribution
umu/umu_version.json: umu/umu_version.json.in
$(info :: Updating $(@) )
cp $(<) $(<).tmp
sed 's|@UMU_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp
sed 's|@REAPER_VERSION@|$(shell git describe --always --long --tags)|g' -i $(<).tmp
mv $(<).tmp $(@)
.PHONY: version
version: umu/umu_version.json
version-install: version
$(info :: Installing umu_version.json )
install -d $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_version.json -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
UMU_RUN_COMMAND = $(DATADIR)/$(INSTALLDIR)/umu_run.py
$(OBJDIR)/.build-umu: | $(OBJDIR)
$(info :: Building umu )
sed 's|@INSTALL_PATH@|$(UMU_RUN_COMMAND)|g' umu/umu-run.in > $(OBJDIR)/umu-run
touch $(@)
.PHONY: umu
umu: $(OBJDIR)/.build-umu
umu-bin-install: umu
install -d $(DESTDIR)$(BINDIR)
install -Dm 755 $(OBJDIR)/$(<)-run $(DESTDIR)$(BINDIR)/umu-run
$(OBJDIR)/.build-umu-docs: | $(OBJDIR)
$(info :: Building umu man pages )
scdoc < docs/umu.1.scd > $(OBJDIR)/umu.1
scdoc < docs/umu.5.scd > $(OBJDIR)/umu.5
touch $(@)
.PHONY: umu-docs
umu-docs: $(OBJDIR)/.build-umu-docs
umu-docs-install: umu-docs
$(info :: Installing umu man pages )
install -d $(DESTDIR)$(MANDIR)/man1
install -d $(DESTDIR)$(MANDIR)/man5
install -m644 $(OBJDIR)/umu.1 $(DESTDIR)$(MANDIR)/man1/umu.1
install -m644 $(OBJDIR)/umu.5 $(DESTDIR)$(MANDIR)/man5/umu.5
umu-dist-install:
$(info :: Installing umu )
install -d $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_consts.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_dl_util.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_log.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_plugins.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 755 umu/umu_run.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
install -Dm 644 umu/umu_util.py -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
ifeq ($(FLATPAK), xtrue)
umu-install: version-install umu-dist-install umu-bin-install
else
umu-install: version-install umu-dist-install umu-docs-install umu-bin-install
endif
ifeq ($(FLATPAK), xtrue)
UMU_LAUNCHER_COMMAND = org.openwinecomponents.umu.umu-launcher
else
UMU_LAUNCHER_COMMAND = $(UMU_RUN_COMMAND)
endif
# umu-launcher is separate to allow control over installing the bin target
$(OBJDIR)/.build-umu-launcher: | $(OBJDIR)
$(info :: Building umu-launcher )
sed 's|@INSTALL_PATH@|$(UMU_LAUNCHER_COMMAND)|g' umu/umu-launcher/umu-run.in > $(OBJDIR)/umu-launcher-run
touch $(@)
.PHONY: umu-launcher
umu-launcher: $(OBJDIR)/.build-umu-launcher
umu-launcher-bin-install: umu-launcher
install -d $(DESTDIR)$(DATADIR)/steam/compatibilitytools.d/umu-launcher
install -Dm 755 $(OBJDIR)/$(<)-run $(DESTDIR)$(DATADIR)/steam/compatibilitytools.d/umu-launcher/umu-run
umu-launcher-dist-install:
$(info :: Installing umu-launcher )
install -d $(DESTDIR)$(DATADIR)/steam/compatibilitytools.d/umu-launcher
install -Dm 644 umu/umu-launcher/compatibilitytool.vdf -t $(DESTDIR)$(DATADIR)/steam/compatibilitytools.d/umu-launcher
install -Dm 644 umu/umu-launcher/toolmanifest.vdf -t $(DESTDIR)$(DATADIR)/steam/compatibilitytools.d/umu-launcher
umu-launcher-install: umu-launcher-dist-install umu-launcher-bin-install
$(OBJDIR)/.build-reaper: | $(OBJDIR)
$(info :: Building reaper )
meson setup $(OBJDIR)/reaper subprojects/reaper
ninja -C $(OBJDIR)/reaper -v
touch $(@)
.PHONY: reaper
reaper: $(OBJDIR)/.build-reaper
reaper-install: reaper
$(info :: Installing reaper )
install -Dm 755 $(OBJDIR)/$</$< -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
$(OBJDIR):
@mkdir -p $(@)
.PHONY: clean
clean:
$(info :: Cleaning source directory )
@rm -rf -v $(OBJDIR) umu/umu_version.json ./$(RELEASEDIR) $(RELEASEDIR).tar.gz
RELEASEDIR := $(PROJECT)-$(shell git describe --abbrev=0)
$(RELEASEDIR):
mkdir -p $(@)
.PHONY: release
release: $(RELEASEDIR) | version
$(info :: Creating source distribution for release )
mkdir -p $(<)
rm -rf umu/__pycache__
cp -r umu packaging subprojects Makefile.in configure.sh README.md LICENSE $(<)
tar -cvzf $(<).tar.gz $(<)
.PHONY: uninstall
# NEVER use a wildcard here
uninstall:
$(info :: Removing $(INSTALLDIR) files in $(DESTDIR)$(BINDIR) )
@rm -rf -v --preserve-root=all $(DESTDIR)$(BINDIR)/umu-run
$(info :: Removing $(INSTALLDIR) directory in $(DESTDIR)$(DATADIR) )
@rm -rf -v --preserve-root=all $(DESTDIR)$(DATADIR)/$(INSTALLDIR)
.PHONY: user-install
user-install:
$(info :: --- )
$(info :: Installed under user-only location "$(DATADIR)/$(INSTALLDIR)" )
$(info :: To run you need to make sure "$(BINDIR)" is in your PATH )
# vim: ft=make