--- Makefile.orig	2003-08-04 17:18:14.000000000 +0200
+++ Makefile	2007-03-15 21:42:43.000000000 +0100
@@ -15,6 +15,10 @@
 #You have received a copy of the GNU General Public License
 #along with the MFFM FFTw Wrapper library
 
+LIB     = $(DESTDIR)/usr/lib
+INC     = $(DESTDIR)/usr/include/mffm
+DOCS     = $(DESTDIR)/usr/share/doc/mffm-fftw-dev
+
 CC=g++ -O3
 #CC=g++-3.0 -O3
 #CC=g++-3.2 -O3
@@ -43,8 +47,8 @@
 	doxygen
 
 libs:
-	$(MAKELIB),libfft.so.0.1 -o libfft.so.0.1 $(OBJ)
-	$(MAKELIB),lib2Dfft.so.0.1 -o lib2Dfft.so.0.1 $(OBJ2D)
+	$(MAKELIB),libfft.so.1 -o libfft.so.1 $(OBJ)
+	$(MAKELIB),lib2Dfft.so.1 -o lib2Dfft.so.1 $(OBJ2D)
 
 ex:
 #fftw V2
@@ -52,9 +56,19 @@
 #	$(CC) *.o -lrfftw -lfftw real2DFFTExample.cc -o real2DFFTExample
 #	$(CC) *.o -lrfftw -lfftw realFFTExample.cc -o realFFTExample
 #fftw V3
-	$(CC) *.o -lfftw3 complexFFTExample.cc -o complexFFTExample
-	$(CC) *.o -lfftw3 real2DFFTExample.cc -o real2DFFTExample
-	$(CC) *.o -lfftw3 realFFTExample.cc -o realFFTExample
+#	$(CC) *.o -lfftw3 complexFFTExample.cc -o complexFFTExample
+#	$(CC) *.o -lfftw3 real2DFFTExample.cc -o real2DFFTExample
+#	$(CC) *.o -lfftw3 realFFTExample.cc -o realFFTExample
+
+install: $(OBJ) \
+	$(OBJ2D) \
+	libs \
+	docs
+	install --directory $(LIB) $(INC) $(DOCS)/html $(DOCS)/examples
+	install lib* $(LIB)
+	install -m 644 *.H $(INC)
+	install html/* $(DOCS)/html
+	install -m 644 complexFFTExample.cc real2DFFTExample.cc realFFTExample.cc sine.1000Hz.dat $(DOCS)/examples
 
 clean:
-	rm -f $(EXAMPLES) *.o a.out *~ *.txt lib*.so.0.1 complexFFTExample realFFTExample real2DFFTExample
+	rm -f $(EXAMPLES) *.o a.out *~ *.txt lib*.so.* complexFFTExample realFFTExample real2DFFTExample
