Index: trunk/Ohana/src/opihi/cmd.astro/Makefile
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 4746)
+++ trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 4747)
@@ -21,5 +21,5 @@
 # astro user commands ########################
 
-astrocmd = \
+srcs = \
 $(SDIR)/init.$(ARCH).o             \
 $(SDIR)/biassub.$(ARCH).o	   \
@@ -50,7 +50,5 @@
 $(SDIR)/spec.$(ARCH).o		   \
 $(SDIR)/star.$(ARCH).o		   \
-$(SDIR)/transform.$(ARCH).o
-
-imfitstuff = \
+$(SDIR)/transform.$(ARCH).o        \
 $(SDIR)/imsub.$(ARCH).o		   \
 $(SDIR)/imfit.$(ARCH).o		   \
@@ -65,59 +63,20 @@
 $(SDIR)/imfit-qrgauss.$(ARCH).o	   
 
-libastrocmd:    $(DESTLIB)/libastrocmd.a 
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
 
-$(LIB)/libastrocmd.$(ARCH).a:   	$(astrocmd) $(imfitstuff)
-
-# utilities #################################################
-$(BIN)/%.$(ARCH):
-	@if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi
-	$(CC) $^ -o $@ $(LFLAGS) $(LIBS)
-	@echo "compiled $*"
-	@echo ""
-
-$(DESTBIN)/%: $(BIN)/%.$(ARCH) 
-	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN); fi
-	rm -f $(DESTBIN)/$*
-	cp $(BIN)/$*.$(ARCH) $(DESTBIN)/$*
-	@echo "installed $*"
-	@echo ""
-
-$(LIB)/%.$(ARCH).a:
-	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
-	rm -f $@
-	ar rcv $@ $^ 
-	$(RANLIB) $@
-	@echo "compiled library $*"
-	@echo ""
-
-$(DESTLIB)/%.a: $(LIB)/%.$(ARCH).a
-	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
-	@echo ""
-	rm -f $@
-	cp $^ $@
-
-lib%.clean:
-	rm -f $(LIB)/lib$*.$(ARCH).a
-	rm -f $($*)
-	@echo ""
-
-%.clean:
-	rm -f $(BIN)/$*.$(ARCH)
-	@echo ""
-
-%.$(ARCH).o : %.c
-	$(CC) $(CFLAGS) -c $*.c -o $@
-
-clean:
-	rm -f $(BIN)/*.$(ARCH)
-	rm -f $(LIB)/*.$(ARCH).a
-	rm -f `find . -name "*.o"`
-	rm -f `find . -name "*~"`
-	rm -f `find . -name "#*"`
-
-dist: clean
-	rm -f $(BIN)/*
-	rm -f $(LIB)/*
+libastrocmd: $(DESTLIB)/libastrocmd.a 
+$(DESTLIB)/libastrocmd.a: $(LIB)/libastrocmd.$(ARCH).a
+$(LIB)/libastrocmd.$(ARCH).a: $(srcs)
+$(srcs): $(incs)
 
 uninstall:
-	rm -f $(DESTLIB)/libcmdastro.a
+	rm -f $(DESTLIB)/libastrocmd.a
+
+include ../Makefile.Common
