--- Makefile 2014-12-08 09:11:10.188596202 +0100 +++ Makefile 2014-12-08 09:11:17.556595651 +0100 @@ -1,9 +1,9 @@ PROG = usb-modeswitch-data VERS = 20140529 RM = /bin/rm -f -PREFIX = $(DESTDIR)/usr -ETCDIR = $(DESTDIR)/etc -RULESDIR = $(DESTDIR)/lib/udev/rules.d +PREFIX = /usr +ETCDIR = /etc +RULESDIR = /lib/udev/rules.d .PHONY: clean @@ -18,26 +18,26 @@ install: all files-install db-install ru install-packed: files-install db-install-packed rules-reload files-install: - install -d $(PREFIX)/share/usb_modeswitch - install -d $(ETCDIR)/usb_modeswitch.d - install -D --mode=644 40-usb_modeswitch.rules $(RULESDIR)/40-usb_modeswitch.rules + install -d $(DESTDIR)/$(PREFIX)/share/usb_modeswitch + install -d $(DESTDIR)/$(ETCDIR)/usb_modeswitch.d + install -D --mode=644 40-usb_modeswitch.rules $(DESTDIR)/$(RULESDIR)/40-usb_modeswitch.rules 40-usb_modeswitch.rules: ./gen-rules.tcl db-install: files-install - install --mode=644 -t $(PREFIX)/share/usb_modeswitch ./usb_modeswitch.d/* + install --mode=644 -t $(DESTDIR)/$(PREFIX)/share/usb_modeswitch ./usb_modeswitch.d/* db-install-packed: @# Create a compressed tar without gzip timestamp, so tar.gz @# differs only if content is different cd ./usb_modeswitch.d; tar -cf ../configPack.tar * gzip -f9n ./configPack.tar - install --mode=644 -t $(PREFIX)/share/usb_modeswitch ./configPack.tar.gz + install --mode=644 -t $(DESTDIR)/$(PREFIX)/share/usb_modeswitch ./configPack.tar.gz rm -f ./configPack.tar.gz rules-reload: - @if [ -f $(ETCDIR)/issue ]; then \ + @if [ -f $(DESTDIR)/$(ETCDIR)/issue ]; then \ UDEVADM=`which udevadm 2>/dev/null`; \ if [ "x$$UDEVADM" != "x" ]; then \ UDEVADM_VER=`$$UDEVADM -V 2>/dev/null`; \ @@ -57,7 +57,7 @@ rules-reload: uninstall: files-uninstall rules-reload files-uninstall: - $(RM) $(RULESDIR)/40-usb_modeswitch.rules - $(RM) -R $(PREFIX)/share/usb_modeswitch + $(RM) $(DESTDIR)/$(RULESDIR)/40-usb_modeswitch.rules + $(RM) -R $(DESTDIR)/$(PREFIX)/share/usb_modeswitch .PHONY: clean install uninstall