From 0dc9e82f4eead77cac3160c3b101b5e3c86b9edc Mon Sep 17 00:00:00 2001 From: Alex Daz Date: Sat, 6 Feb 2021 13:59:13 -0500 Subject: [PATCH] don't hardcode /etc to ease packaging building RPMs and DEBs for distribution usually requires building the software on a buildroot. Hardcoding /etc breaks in that case and doesn't allow for easy packaging. This commit tries to fix that. --- makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 2126f3e..497b400 100644 --- a/makefile +++ b/makefile @@ -3,6 +3,7 @@ PREFIX = /usr BIN_DIR = $(PREFIX)/bin DOC_DIR = $(PREFIX)/share/doc MAN_DIR = $(PREFIX)/share/man/man1 +ETC_DIR = /etc # compiler options CC = c++ @@ -19,7 +20,7 @@ build: m908 m709 m711 m715 m990 m990chroma generic data_rd.o rd_mouse.o load_con # copy all files to their correct location install: cp ./mouse_m908 $(BIN_DIR)/mouse_m908 && \ - cp ./mouse_m908.rules /etc/udev/rules.d && \ + cp ./mouse_m908.rules $(ETC_DIR)/udev/rules.d && \ mkdir $(DOC_DIR)/mouse_m908 | true && \ cp ./examples/* $(DOC_DIR)/mouse_m908/ && \ cp ./README.md $(DOC_DIR)/mouse_m908/ && \ @@ -42,7 +43,7 @@ clean: # remove all installed files uninstall: rm -f $(BIN_DIR)/mouse_m908 && \ - rm -f /etc/udev/rules.d/mouse_m908.rules && \ + rm -f $(ETC_DIR)/udev/rules.d/mouse_m908.rules && \ rm -rf $(DOC_DIR)/mouse_m908 && \ rm -f $(MAN_DIR)/mouse_m908.1