--- Makefile	2009-05-02 09:19:11.000000000 +0200
+++ Makefile-new	2010-04-13 16:53:21.008682368 +0200
@@ -1,6 +1,6 @@
 all: library all_samples 
 
-CFLAGS=-O4  -I. -w
+CFLAGS=-O2 -fPIC  -I. -w
 
 # OpenMP support
 #CFLAGS=-O4  -I. -w -fopenmp
@@ -18,12 +18,9 @@
 all_samples: bin/raw-identify bin/simple_dcraw  bin/dcraw_emu bin/dcraw_half bin/half_mt bin/mem_image bin/unprocessed_raw bin/4channels
 
 install: library
-	@if [ -d /usr/local/include ] ; then cp -R libraw /usr/local/include/ ; else echo 'no /usr/local/include' ; fi
-	@if [ -d /usr/local/lib ] ; then cp lib/libraw.a lib/libraw_r.a /usr/local/lib/ ; else echo 'no /usr/local/lib' ; fi
-
-install-binaries: all_samples
-	@if [ -d /usr/local/bin ] ; then cp bin/[a-z]* /usr/local/bin/ ; else echo 'no /usr/local/bin' ; fi
-
+	cp -R libraw $(DESTDIR)/usr/include/
+	cp lib/libraw.a lib/libraw_r.a $(DESTDIR)/usr/lib64/
+	cp bin/[a-z]* $(DESTDIR)/usr/bin/
 
 #binaries
 
