retroarch-standalone-service/Makefile

75 lines
2.6 KiB
Makefile
Raw Normal View History

2022-09-19 10:53:54 +02:00
PN = retroarch-standalone-service
2020-12-19 03:12:42 +01:00
PREFIX ?= /usr
INITDIR = $(PREFIX)/lib/systemd/system
USERDIR = $(PREFIX)/lib/sysusers.d
TMPFDIR = $(PREFIX)/lib/tmpfiles.d
2021-02-16 13:18:17 +01:00
UDEVDIR = $(PREFIX)/lib/udev/rules.d
POLKDIR = $(PREFIX)/share/polkit/rules.d
2021-03-13 13:31:37 +01:00
MANDIR = $(PREFIX)/share/man/man1
ENVDIR = /etc/conf.d
2020-12-19 03:12:42 +01:00
RM = rm
INSTALL = install -p
INSTALL_DIR = $(INSTALL) -d
INSTALL_PROGRAM = $(INSTALL) -m755
INSTALL_DATA = $(INSTALL) -m644
IS_ARCH_ARM := $(shell uname -m | grep -q -E "^(arm|aarch64)"; echo $$?)
2022-01-17 10:34:17 +01:00
ifeq ($(IS_ARCH_ARM), 0)
ARCH = arm
else
ARCH = x86
endif
2020-12-19 03:12:42 +01:00
common/$(PN):
@echo -e '\033[1;32mNothing to be done.\033[0m'
@echo -e '\033[1;32mJust run make install as root.\033[0m'
2021-02-16 13:18:17 +01:00
install-common:
$(INSTALL_DIR) "$(DESTDIR)$(UDEVDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(ENVDIR)"
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/udev/99-retroarch.rules "$(DESTDIR)$(UDEVDIR)/99-retroarch.rules"
$(INSTALL_DATA) common/retroarch-standalone "$(DESTDIR)$(ENVDIR)/retroarch-standalone"
2022-01-17 10:34:17 +01:00
ifeq ($(ARCH),arm)
$(INSTALL_DIR) "$(DESTDIR)$(POLKDIR)"
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/polkit/polkit.rules "$(DESTDIR)$(POLKDIR)/99-retroarch.rules"
2022-01-17 10:34:17 +01:00
endif
2021-02-16 13:18:17 +01:00
2020-12-19 03:12:42 +01:00
install-init:
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(USERDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(TMPFDIR)"
2022-01-17 10:34:17 +01:00
ifeq ($(ARCH),x86)
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/init/retroarch-gbm.service "$(DESTDIR)$(INITDIR)/retroarch-gbm.service"
$(INSTALL_DATA) $(ARCH)/init/retroarch-wayland.service "$(DESTDIR)$(INITDIR)/retroarch-wayland.service"
$(INSTALL_DATA) $(ARCH)/init/retroarch-x11.service "$(DESTDIR)$(INITDIR)/retroarch-x11.service"
2022-01-17 10:34:17 +01:00
else
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/init/retroarch.service "$(DESTDIR)$(INITDIR)/retroarch.service"
2022-01-17 10:34:17 +01:00
endif
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/init/tmpfiles.conf "$(DESTDIR)$(TMPFDIR)/retroarch-standalone.conf"
$(INSTALL_DATA) $(ARCH)/init/sysusers.conf "$(DESTDIR)$(USERDIR)/retroarch-standalone.conf"
2020-12-19 03:12:42 +01:00
2021-03-13 13:31:37 +01:00
install-man:
$(INSTALL_DIR) "$(DESTDIR)$(MANDIR)"
2022-09-19 10:53:54 +02:00
$(INSTALL_DATA) $(ARCH)/doc/retroarch.service.1 "$(DESTDIR)$(MANDIR)/retroarch.service.1"
2021-03-13 13:31:37 +01:00
2020-12-19 03:12:42 +01:00
uninstall:
2022-01-17 10:34:17 +01:00
ifeq ($(ARCH),x86)
2022-09-19 10:53:54 +02:00
$(RM) "$(DESTDIR)$(INITDIR)/retroarch-gbm.service"
$(RM) "$(DESTDIR)$(INITDIR)/retroarch-wayland.service"
$(RM) "$(DESTDIR)$(INITDIR)/retroarch-x11.service"
2022-01-17 10:34:17 +01:00
else
2022-09-19 10:53:54 +02:00
$(RM) "$(DESTDIR)$(INITDIR)/retroarch.service"
$(RM) "$(DESTDIR)$(POLKDIR)/99-retroarch.rules"
2022-01-17 10:34:17 +01:00
endif
2022-09-19 10:53:54 +02:00
$(RM) "$(DESTDIR)$(TMPFDIR)/retroarch-standalone.conf"
$(RM) "$(DESTDIR)$(USERDIR)/retroarch-standalone.conf"
$(RM) "$(DESTDIR)$(UDEVDIR)/99-retroarch.rules"
$(RM) "$(DESTDIR)$(MANDIR)/retroarch.service.1"
$(RM) "$(DESTDIR)$(ENVDIR)/retroarch-standalone"
2020-12-19 03:12:42 +01:00
2021-03-13 13:31:37 +01:00
install: install-common install-init install-man
2020-12-19 03:12:42 +01:00
2021-02-16 13:18:17 +01:00
.PHONY: install-common install-init uninstall