Index: trunk/stac/src/Makefile
===================================================================
--- trunk/stac/src/Makefile	(revision 2500)
+++ trunk/stac/src/Makefile	(revision 2661)
@@ -1,7 +1,7 @@
 SHELL = /bin/sh
 CC = gcc
-CFLAGS = -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include # -DTESTING
-PSLIB = -L/home/mithrandir/price/psLib3/psLib/lib/ -lpslib -lgsl -lgslcblas -lfftw3f -lsla -lcfitsio -lm
-LDFLAGS = $(PSLIB)
+CFLAGS += -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include -DTESTING -DCRFLUX
+PSLIB += -L/home/mithrandir/price/psLib3/psLib/lib/ -lpslib -lgsl -lgslcblas -lfftw3f -lsla -lcfitsio -lm
+LDFLAGS += $(PSLIB)
 
 OBJECTS = stac.o stacConfig.o stacRead.o stacErrorImages.o stacTransform.o stacCheckMemory.o \
@@ -18,4 +18,7 @@
 		$(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) $(OPTFLAGS)
 
+calcGrad:	calcGrad.o
+		$(CC) $(CFLAGS) -o $@ calcGrad.o $(LDFLAGS) $(OPTFLAGS)
+
 clean:
 		-$(RM) *.o gmon.* profile.txt
@@ -27,11 +30,12 @@
 		-$(RM) testout.fits
 		-$(RM) testout.fits.pre
+		-$(RM) chi2_*.fits
 		-$(RM) test_[0-3].fits.err
 		-$(RM) test_[0-3].fits.mask
-		-$(RM) test_[0-3].fits.shift.?
+		-$(RM) test_[0-3].fits.shift.*
 		-$(RM) test_[0-3].fits.shiftrej
 		-$(RM) test_[0-3].fits.shifterr.*
 		-$(RM) leaks.dat
-		./stac -v testout.fits test_0.fits test_1.fits test_2.fits test_3.fits
+		./stac -v -k 2.5 -f 0.3 -G 0.6 testout.fits test_0.fits test_1.fits test_2.fits test_3.fits
 
 # Run profiling.
@@ -49,8 +53,8 @@
 optimise:	clean
 		-$(RM) $(TARGET)
-		export OPTFLAGS=-fprofile-arcs ; $(MAKE) test
+		export OPTFLAGS=-fprofile-generate ; $(MAKE) test
 		-$(RM) $(TARGET)
 		$(MAKE) clean
-		export OPTFLAGS=-fbranch-probabilities ; $(MAKE) $(TARGET)
+		export OPTFLAGS=-fbranch-use ; $(MAKE) $(TARGET)
 		-$(RM) *.da
 
