Honor DESTDIR in install rules
authorSamuel Martin <s.martin49@gmail.com>
Sun, 08 Jun 2014 17:42:47 +0200
changeset 790 1936110171a2
parent 789 a82d867e7850
child 791 7740ac6fdedc
Honor DESTDIR in install rules

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
drivers/can_anagate_linux/Makefile
drivers/can_anagate_linux/Makefile.in
drivers/can_anagate_win32/Makefile.in
drivers/can_can4linux/Makefile.in
drivers/can_copcican_linux/Makefile.in
drivers/can_kvaser/Makefile.in
drivers/can_lincan/Makefile.in
drivers/can_peak_linux/Makefile.in
drivers/can_peak_win32/Makefile.in
drivers/can_serial/Makefile.in
drivers/can_socket/Makefile.in
drivers/can_tcp_win32/Makefile.in
drivers/can_virtual/Makefile.in
drivers/can_vscom/Makefile.in
drivers/timers_rtai/Makefile.in
drivers/timers_unix/Makefile.in
drivers/timers_win32/Makefile.in
drivers/timers_xeno/Makefile.in
drivers/unix/Makefile.in
drivers/win32/Makefile.in
examples/CANOpenShell/Makefile.in
examples/DS401_Master/Makefile.in
examples/DS401_Slave_Gui/Makefile.in
examples/SillySlave/Makefile.in
examples/TestMasterMicroMod/Makefile.in
examples/TestMasterSlave/Makefile.in
examples/TestMasterSlaveLSS/Makefile.in
examples/kerneltest/Makefile.in
examples/test_copcican_linux/Makefile.in
objdictgen/Makefile.in
src/Makefile.in
--- a/drivers/can_anagate_linux/Makefile	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_anagate_linux/Makefile	Sun Jun 08 17:42:47 2014 +0200
@@ -43,7 +43,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -56,8 +56,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_anagate_linux/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_anagate_linux/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -43,7 +43,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -56,8 +56,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_anagate_win32/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_anagate_win32/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -46,7 +46,7 @@
 endif
 
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -69,8 +69,8 @@
 	-Wl,--exclude-libs,ALL -lws2_32
 		
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_can4linux/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_can4linux/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -42,7 +42,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -55,8 +55,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 	
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/can_copcican_linux/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_copcican_linux/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -45,7 +45,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -58,8 +58,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_kvaser/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_kvaser/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -52,7 +52,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -65,8 +65,8 @@
 	$(CC) -shared -Wl,-soname,$(DRIVER) $(CAN_DLL_CFLAGS) -o $@ $< 
 
 install: $(DRIVER)
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_lincan/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_lincan/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -42,7 +42,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -55,8 +55,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 	
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/can_peak_linux/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_peak_linux/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -43,7 +43,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -56,8 +56,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so -o $@ $< $(CAN_DLL_CFLAGS)
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_peak_win32/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_peak_win32/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -45,7 +45,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -63,8 +63,8 @@
 	-Wl,--exclude-libs,ALL
 		
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_serial/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_serial/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -46,8 +46,8 @@
 
 HUB=can_serial_hub
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
-TARGET_BINFILES = $(PREFIX)/bin/$(HUB)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
+TARGET_BINFILES = $(DESTDIR)$(PREFIX)/bin/$(HUB)
 
 all: driver $(HUB)
 
@@ -63,10 +63,10 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so $(HUB)
-	mkdir -p $(PREFIX)/lib/
-	cp libcanfestival_$(CAN_DRIVER).so $(PREFIX)/lib/
-	mkdir -p $(PREFIX)/bin/
-	cp $(HUB) $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp libcanfestival_$(CAN_DRIVER).so $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $(HUB) $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_socket/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_socket/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -43,7 +43,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -56,8 +56,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 	
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_tcp_win32/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_tcp_win32/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -47,7 +47,7 @@
 
 SERVER = $(CAN_DRIVER)_server
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -74,8 +74,8 @@
 	-Wl,--exclude-libs,ALL -lws2_32
 		
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 		
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_virtual/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_virtual/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -43,7 +43,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -56,8 +56,8 @@
 	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 	
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/can_vscom/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/can_vscom/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -61,7 +61,7 @@
 DRIVER = $(OBJS)
 endif
 
-TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
+TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER)
 
 all: driver
 
@@ -83,8 +83,8 @@
 	$(CC) $(PROG_CFLAGS) -shared $(CAN_VSCOM_DLL_FLAGS) -o $@ $< $(CAN_DLL_CFLAGS)
 
 install: libcanfestival_$(CAN_DRIVER).so
-	mkdir -p $(PREFIX)/lib/
-	cp $< $(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	cp $< $(DESTDIR)$(PREFIX)/lib/
 
 uninstall:
 	rm -f $(TARGET_SOFILES)
--- a/drivers/timers_rtai/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/timers_rtai/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -38,7 +38,7 @@
 
 SRC_HFILES = ../../include/$(TIMERS_DRIVER)/timerscfg.h
 
-TARGET_HFILES = $(PREFIX)/include/canfestival/timerscfg.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/canfestival/timerscfg.h
 
 all: driver
 
@@ -48,8 +48,8 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install:
-	mkdir -p $(PREFIX)/include/canfestival
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/timers_unix/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/timers_unix/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -38,7 +38,7 @@
 
 SRC_HFILES = ../../include/$(TIMERS_DRIVER)/timerscfg.h
 
-TARGET_HFILES = $(PREFIX)/include/canfestival/timerscfg.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/canfestival/timerscfg.h
 
 all: driver
 
@@ -48,8 +48,8 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install:
-	mkdir -p $(PREFIX)/include/canfestival
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/timers_win32/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/timers_win32/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -40,7 +40,7 @@
 
 SRC_HFILES = ../../include/$(TIMERS_DRIVER)/timerscfg.h
 
-TARGET_HFILES = $(PREFIX)/include/canfestival/timerscfg.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/canfestival/timerscfg.h
 
 all: driver
 
@@ -50,8 +50,8 @@
 	$(CXX) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install:
-	mkdir -p $(PREFIX)/include/canfestival
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/timers_xeno/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/timers_xeno/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -38,7 +38,7 @@
 
 SRC_HFILES = ../../include/$(TIMERS_DRIVER)/timerscfg.h
 
-TARGET_HFILES = $(PREFIX)/include/canfestival/timerscfg.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/canfestival/timerscfg.h
 
 all: driver
 
@@ -48,8 +48,8 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install:
-	mkdir -p $(PREFIX)/include/canfestival
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
 	rm -f $(TARGET_HFILES)
--- a/drivers/unix/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/unix/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -51,7 +51,7 @@
 
 SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h
 
-TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/$(TARGET)/applicfg.h $(DESTDIR)$(PREFIX)/include/$(TARGET)/canfestival.h
 
 all: driver
 
@@ -104,13 +104,13 @@
 	$(BINUTILS_PREFIX)ranlib $@
 
 install: libcanfestival_$(TARGET).a
-	mkdir -p $(PREFIX)/lib/
-	mkdir -p $(PREFIX)/include/canfestival
-	cp libcanfestival_$(TARGET).a $(PREFIX)/lib/
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp libcanfestival_$(TARGET).a $(DESTDIR)$(PREFIX)/lib/
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
-	rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a
+	rm -f $(DESTDIR)$(PREFIX)/lib/libcanfestival_$(TARGET).a
 	rm -f $(TARGET_HFILES)
 
 clean:
--- a/drivers/win32/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/drivers/win32/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -47,7 +47,7 @@
 
 SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h
 
-TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h
+TARGET_HFILES = $(DESTDIR)$(PREFIX)/include/$(TARGET)/applicfg.h $(DESTDIR)$(PREFIX)/include/$(TARGET)/canfestival.h
 
 all: driver
 
@@ -71,13 +71,13 @@
 	$(BINUTILS_PREFIX)ranlib $@
 
 install: libcanfestival_$(TARGET).a
-	mkdir -p $(PREFIX)/lib/
-	mkdir -p $(PREFIX)/include/canfestival
-	cp libcanfestival_$(TARGET).a $(PREFIX)/lib/
-	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp libcanfestival_$(TARGET).a $(DESTDIR)$(PREFIX)/lib/
+	cp $(SRC_HFILES) $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
-	rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a
+	rm -f $(DESTDIR)$(PREFIX)/lib/libcanfestival_$(TARGET).a
 	rm -f $(TARGET_HFILES)
 
 clean:
--- a/examples/CANOpenShell/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/CANOpenShell/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -87,8 +87,8 @@
 	rm -f CANOpenShellSlaveOD.c
 
 install: $(CANOPENSHELL)
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/$(CANOPENSHELL)
\ No newline at end of file
+	rm -f $(DESTDIR)$(PREFIX)/bin/$(CANOPENSHELL)
\ No newline at end of file
--- a/examples/DS401_Master/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/DS401_Master/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -66,10 +66,10 @@
 	rm -f TestMaster.c
 	
 install: DS401_Master
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/DS401_Master
+	rm -f $(DESTDIR)$(PREFIX)/bin/DS401_Master
 
 
--- a/examples/DS401_Slave_Gui/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/DS401_Slave_Gui/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -75,11 +75,11 @@
 	$(RM) $(EXEC) $(DEPEND_FILE)
 	
 install: DS401_Slave_Gui
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/DS401_Slave_Gui
+	rm -f $(DESTDIR)$(PREFIX)/bin/DS401_Slave_Gui
 
 $(EXEC): $(OBJS)
 	$(LD) $(OBJS) `wx-config --libs` -o $(EXEC)
--- a/examples/SillySlave/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/SillySlave/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -66,10 +66,10 @@
 	rm -f SillySlave.c
 	
 install: SillySlave
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/SillySlave
+	rm -f $(DESTDIR)$(PREFIX)/bin/SillySlave
 
 
--- a/examples/TestMasterMicroMod/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/TestMasterMicroMod/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -74,10 +74,10 @@
 	rm -f TestMaster.c
 	
 install: TestMasterMicroMod
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/TestMasterMicroMod
+	rm -f $(DESTDIR)$(PREFIX)/bin/TestMasterMicroMod
 
 
--- a/examples/TestMasterSlave/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/TestMasterSlave/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -87,11 +87,11 @@
 	rm -f TestMaster.c
 	
 install: TestMasterSlave
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/TestMasterSlave
+	rm -f $(DESTDIR)$(PREFIX)/bin/TestMasterSlave
 
 
 
--- a/examples/TestMasterSlaveLSS/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/TestMasterSlaveLSS/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -87,11 +87,11 @@
 	rm -f TestMaster.c
 	
 install: TestMasterSlaveLSS
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 	
 uninstall:
-	rm -f $(PREFIX)/bin/TestMasterSlaveLSS
+	rm -f $(DESTDIR)$(PREFIX)/bin/TestMasterSlaveLSS
 
 
 
--- a/examples/kerneltest/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/kerneltest/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -67,12 +67,12 @@
 
 install:
 	$(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules_install
-	mkdir -p $(PREFIX)/bin/
-	cp console/canf_ktest_console $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp console/canf_ktest_console $(DESTDIR)$(PREFIX)/bin/
 	/bin/sh insert.sh
 
 uninstall:
-	rm -f $(PREFIX)/bin/canf_ktest_console
+	rm -f $(DESTDIR)$(PREFIX)/bin/canf_ktest_console
 
 canf_ktest_console: console/console.c console/console.h
 	$(CC) console/console.c -o console/canf_ktest_console
--- a/examples/test_copcican_linux/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/examples/test_copcican_linux/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -67,10 +67,10 @@
 	rm -f test_copcican_linux.c
 
 install: test_copcican_linux
-	mkdir -p $(PREFIX)/bin/
-	cp $< $(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin/
+	cp $< $(DESTDIR)$(PREFIX)/bin/
 
 uninstall:
-	rm -f $(PREFIX)/bin/test_copcican_linux
+	rm -f $(DESTDIR)$(PREFIX)/bin/test_copcican_linux
 
 
--- a/objdictgen/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/objdictgen/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -35,19 +35,19 @@
 	rm -rf gnosis_extract
 
 install: gnosis
-	mkdir -p $(PREFIX)/objdictgen
-	cp -r *.py* config doc doc_index locale examples gnosis *.ico $(PREFIX)/objdictgen
-	chmod -R a+r $(PREFIX)/objdictgen
-	mkdir -p $(PREFIX)/bin
-	ln -sf $(PREFIX)/objdictgen/objdictedit.py $(PREFIX)/bin/objdictedit
-	chmod 755 $(PREFIX)/objdictgen/objdictedit.py
-	ln -sf $(PREFIX)/objdictgen/objdictgen.py $(PREFIX)/bin/objdictgen
-	chmod 755 $(PREFIX)/objdictgen/objdictgen.py
+	mkdir -p $(DESTDIR)$(PREFIX)/objdictgen
+	cp -r *.py* config doc doc_index locale examples gnosis *.ico $(DESTDIR)$(PREFIX)/objdictgen
+	chmod -R a+r $(DESTDIR)$(PREFIX)/objdictgen
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	ln -sf $(DESTDIR)$(PREFIX)/objdictgen/objdictedit.py $(DESTDIR)$(PREFIX)/bin/objdictedit
+	chmod 755 $(DESTDIR)$(PREFIX)/objdictgen/objdictedit.py
+	ln -sf $(DESTDIR)$(PREFIX)/objdictgen/objdictgen.py $(DESTDIR)$(PREFIX)/bin/objdictgen
+	chmod 755 $(DESTDIR)$(PREFIX)/objdictgen/objdictgen.py
 
 uninstall:
-	rm -rf $(PREFIX)/objdictgen
-	rm -f $(PREFIX)/bin/objdictedit
-	rm -f $(PREFIX)/bin/objdictgen
+	rm -rf $(DESTDIR)$(PREFIX)/objdictgen
+	rm -f $(DESTDIR)$(PREFIX)/bin/objdictedit
+	rm -f $(DESTDIR)$(PREFIX)/bin/objdictgen
 
 clean:
 
--- a/src/Makefile.in	Sat Oct 12 09:14:38 2013 +0900
+++ b/src/Makefile.in	Sun Jun 08 17:42:47 2014 +0200
@@ -94,11 +94,11 @@
 
 install:
 	$(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules_install
-	mkdir -p $(PREFIX)/include/canfestival
-	cp ../include/*.h $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp ../include/*.h $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
-	rm -rf $(PREFIX)/include/canfestival
+	rm -rf $(DESTDIR)$(PREFIX)/include/canfestival
 
 else
 CFLAGS = SUB_OPT_CFLAGS
@@ -132,14 +132,14 @@
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install: libcanfestival.a
-	mkdir -p $(PREFIX)/lib/
-	mkdir -p $(PREFIX)/include/canfestival
-	cp libcanfestival.a $(PREFIX)/lib/
-	cp ../include/*.h $(PREFIX)/include/canfestival
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
+	cp libcanfestival.a $(DESTDIR)$(PREFIX)/lib/
+	cp ../include/*.h $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall:
-	rm -f $(PREFIX)/lib/libcanfestival.a
-	rm -rf $(PREFIX)/include/canfestival
+	rm -f $(DESTDIR)$(PREFIX)/lib/libcanfestival.a
+	rm -rf $(DESTDIR)$(PREFIX)/include/canfestival
 
 clean:
 	rm -f $(OBJS) libcanfestival.a libcanfestival.o