--- Makefile.orig	2019-07-14 14:57:50 UTC
+++ Makefile
@@ -11,19 +11,19 @@ XDW_MAX_OPTIMIZATION=2
 
 #=========================== C compiler configuration ==========================
 
-CC     = gcc
-CFLAGS = -I/usr/X11R6/include -O2
+#CC     = gcc
+CFLAGS = -I$(LOCALBASE)/include
 
 #============================= Linker configuration ============================
 
-LINK   = gcc
-LFLAGS = -L/usr/X11R6/lib64 -L/usr/X11R6/lib
+LINK   = $(CC)
+LFLAGS = -L$(LOCALBASE)/lib
 LIBS   = -lm -lX11 -lXext
 
 #============================ Installer configuration ==========================
 
-BINDIR  = /usr/X11R6/bin
-MAN1DIR = /usr/X11R6/man/man1
+BINDIR  = $(LOCALBASE)/bin
+MAN1DIR = $(LOCALBASE)/share/man/man1
 INSTALL = install
 RM      = rm -f -v
 
@@ -41,8 +41,8 @@ clean:
 	$(RM) xdesktopwaves.o
 
 install: xdesktopwaves xdesktopwaves.1
-	$(INSTALL) -c -m 0755 -s xdesktopwaves $(BINDIR)/xdesktopwaves
-	$(INSTALL) -c -m 0444 xdesktopwaves.1 $(MAN1DIR)/xdesktopwaves.1
+	$(INSTALL) -c -m 0755 -s xdesktopwaves ${DESTDIR}$(BINDIR)/xdesktopwaves
+	$(INSTALL) -c -m 0444 xdesktopwaves.1 ${DESTDIR}$(MAN1DIR)/xdesktopwaves.1
 
 uninstall:
 	$(RM) $(BINDIR)/xdesktopwaves
