Index: trunk/Ohana/src/gastro2/Makefile
===================================================================
--- trunk/Ohana/src/gastro2/Makefile	(revision 10305)
+++ trunk/Ohana/src/gastro2/Makefile	(revision 10342)
@@ -1,21 +1,23 @@
+default: gastro2
+help:
+	@echo "make options: gastro2 (default)"
+
 include ../../Configure
 HOME 	=	$(ROOT)/src/gastro2
-PROGRAM =       gastro2
-
 BIN	=	$(HOME)/bin
 LIB	=	$(HOME)/lib
-INC	= 	$(HOME)/include
 SRC	=	$(HOME)/src
 MAN	=	$(HOME)/doc
-DESTBIN	=	$(BINDIR)
-DESTLIB	=	$(LIBDIR)
-DESTINC	=	$(INCDIR)
-DESTMAN	=	$(MANDIR)
+INC	= 	$(HOME)/include
+include ../../Makefile.Common
 
-#  
-CFLAGS	=	-I$(INC) -I$(INCDIR) $(INCDIRS)
-LFLAGS	=	-L$(LIB) -L$(LIBDIR) $(LIBDIRS) -ldvo -lFITS -lohana $(LIBFLAGS) 
+LDFLAGS := 	-ldvo -lFITS -lohana $(LDFLAGS)
 
-2MASS = \
+gastro2: $(BIN)/gastro2.$(ARCH)
+coordtest: $(BIN)/coordtest.$(ARCH)
+extr2mass: $(BIN)/extr2mass.$(ARCH)
+install: $(DESTBIN)/gastro2
+
+EXTR2MASS = \
 $(SRC)/extr2mass.$(ARCH).o \
 $(SRC)/ConfigInit.$(ARCH).o \
@@ -27,5 +29,5 @@
 $(SRC)/polyfit.$(ARCH).o
 
-GASTRO = \
+GASTRO2 = \
 $(SRC)/plots.$(ARCH).o \
 $(SRC)/gheader2.$(ARCH).o \
@@ -54,42 +56,9 @@
 $(SRC)/rtext.$(ARCH).o
 
-#$(SRC)/gptolemy2.$(ARCH).o \
-#$(SRC)/gregions2.$(ARCH).o \
+$(GASTRO2): $(INC)/gastro2.h
+$(COORDTEST): $(INC)/gastro2.h
+$(EXTR2MASS): $(INC)/gastro2.h
 
-OBJ = $(GASTRO)
-
-default: $(PROGRAM)
-
-all: $(PROGRAM) extr2mass
-
-$(GASTRO): $(INC)/gastro2.h
-
-coordtest: $(COORDTEST)
-	$(CC) $(COORDTEST) -o $(BIN)/coordtest.linux $(LFLAGS)
-
-# dependancy rules for binary code ##########################
-$(PROGRAM): $(BIN)/$(PROGRAM).$(ARCH)
-
-$(BIN)/$(PROGRAM).$(ARCH): $(OBJ)
-	@if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi
-	$(CC) $(OBJ) -o $(BIN)/$(PROGRAM).$(ARCH) $(LFLAGS)
-
-install: $(DESTBIN)/$(PROGRAM)
-
-$(DESTBIN)/$(PROGRAM): $(BIN)/$(PROGRAM).$(ARCH)
-	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN); fi
-	rm -f $(DESTBIN)/$(PROGRAM)
-	cp $(BIN)/$(PROGRAM).$(ARCH) $(DESTBIN)/$(PROGRAM)
-
-# utilities #################################################
-clean:	
-	rm -f $(BIN)/*.$(ARCH)
-	rm -f `find . -name "*.o"`
-	rm -f `find . -name "*~"`
-	rm -f `find . -name "#*"`
-
-.PRECIOUS: %.$(ARCH).o
-.PRECIOUS: $(BIN)/%.$(ARCH)
-
-%.$(ARCH).o : %.c
-	$(CC) $(CFLAGS) -c $< -o $@
+$(BIN)/gastro2.$(ARCH): $(GASTRO2)
+$(BIN)/coordtest.$(ARCH): $(COORDTEST)
+$(BIN)/extr2mass.$(ARCH): $(EXTR2MASS)
