Skip to content

Commit a509c04

Browse files
davide125marcan
authored andcommitted
makefile: conditionalize binary scripts directory
Signed-off-by: Davide Cavalca <[email protected]>
1 parent ed97371 commit a509c04

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PREFIX=/usr/local
22
CONFIG_DIR=/etc/default
3+
BIN_DIR=$(PREFIX)/bin
34
SCRIPTS=update-vendor-firmware update-m1n1
45
ARCH_SCRIPTS=update-grub first-boot
56
UNITS=first-boot.service
@@ -16,15 +17,15 @@ build/%: %
1617
chmod +x "$@"
1718

1819
install: all
19-
install -d $(DESTDIR)$(PREFIX)/bin/
20-
install -m0755 -t $(DESTDIR)$(PREFIX)/bin/ $(BUILD_SCRIPTS)
20+
install -d $(DESTDIR)$(BIN_DIR)/
21+
install -m0755 -t $(DESTDIR)$(BIN_DIR)/ $(BUILD_SCRIPTS)
2122
install -dD $(DESTDIR)/etc
2223
install -m0644 -t $(DESTDIR)/etc etc/m1n1.conf
2324
install -dD $(DESTDIR)$(PREFIX)/share/asahi-scripts
2425
install -m0644 -t $(DESTDIR)$(PREFIX)/share/asahi-scripts functions.sh
2526

2627
install-arch: install
27-
install -m0755 -t $(DESTDIR)$(PREFIX)/bin/ $(BUILD_ARCH_SCRIPTS)
28+
install -m0755 -t $(DESTDIR)$(BIN_DIR)/ $(BUILD_ARCH_SCRIPTS)
2829
install -dD $(DESTDIR)$(PREFIX)/lib/systemd/system
2930
install -dD $(DESTDIR)$(PREFIX)/lib/systemd/system/{multi-user,sysinit}.target.wants
3031
install -m0644 -t $(DESTDIR)$(PREFIX)/lib/systemd/system $(addprefix systemd/,$(UNITS))
@@ -42,12 +43,13 @@ install-fedora: install
4243
install -m0644 -t $(DESTDIR)$(DRACUT_CONF_DIR) dracut/10-asahi.conf
4344

4445
uninstall:
45-
rm -f $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(SCRIPTS))
46-
rm -f $(addprefix $(DESTDIR)$(PREFIX)/lib/systemd/system/,$(UNITS))
47-
rm -f $(addprefix $(DESTDIR)$(PREFIX)/lib/systemd/system/multi-user.target.wants/,$(MULTI_USER_WANTS))
46+
rm -f $(addprefix $(DESTDIR)$(BIN_DIR)/,$(SCRIPTS))
4847
rm -rf $(DESTDIR)$(PREFIX)/share/asahi-scripts
4948

5049
uninstall-arch:
50+
rm -f $(addprefix $(DESTDIR)$(BIN_DIR)/,$(ARCH_SCRIPTS))
51+
rm -f $(addprefix $(DESTDIR)$(PREFIX)/lib/systemd/system/,$(UNITS))
52+
rm -f $(addprefix $(DESTDIR)$(PREFIX)/lib/systemd/system/multi-user.target.wants/,$(MULTI_USER_WANTS))
5153
rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/install/asahi
5254
rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/hooks/asahi
5355
rm -f $(DESTDIR)$(PREFIX)/share/libalpm/hooks/95-m1n1-install.hook

0 commit comments

Comments
 (0)