Index: trunk/Ohana/src/libohana/Makefile
===================================================================
--- trunk/Ohana/src/libohana/Makefile	(revision 3593)
+++ trunk/Ohana/src/libohana/Makefile	(revision 3609)
@@ -13,7 +13,5 @@
 DESTMAN	=	$(LMAN)
 
-INCS	= 	-I$(LINC)
-CFLAGS	=	-Wunused -o $*.$(ARCH).o $(INCS) 
-LFLAGS	=	-c $(INCS)
+CFLAGS	=	-I$(LINC) -D$(ARCH)
 
 default: install
@@ -21,9 +19,11 @@
 install: $(DESTLIB)/libohana.a
 
-ohana: $(LIB)/libohana.$(ARCH).a 
+libohana: $(LIB)/libohana.$(ARCH).a 
 
-HOBJ = \
+INC1 = \
 $(DESTINC)/Xohana.h  \
-$(DESTINC)/ohana.h \
+$(DESTINC)/ohana.h
+
+INC2 = \
 $(DESTINC)/loneos.h \
 $(DESTINC)/elixir.h \
@@ -31,5 +31,5 @@
 $(DESTINC)/dvo.h
 
-LOBJ = \
+OBJ1 = \
 $(SRC)/version.$(ARCH).o	 \
 $(SRC)/string.$(ARCH).o		 \
@@ -37,7 +37,9 @@
 $(SRC)/glockfile.$(ARCH).o	 \
 $(SRC)/config.$(ARCH).o		 \
+$(SRC)/Fseek.$(ARCH).o           
+
+OBJ2 = \
 $(SRC)/coordops.$(ARCH).o	 \
 $(SRC)/Fread.$(ARCH).o		 \
-$(SRC)/Fseek.$(ARCH).o           \
 $(SRC)/LoadPhotcodes.$(ARCH).o   \
 $(SRC)/photfits.$(ARCH).o	 \
@@ -48,4 +50,5 @@
 
 AOBJ = \
+$(ASRC)/regimage.$(ARCH).o \
 $(ASRC)/detreg.$(ARCH).o \
 $(ASRC)/photreg.$(ARCH).o \
@@ -55,6 +58,10 @@
 $(ASRC)/spectrum-ascii.$(ARCH).o
 
-autocode:
+autocode: $(INC1)
 	cd $(AUTO) && make install
+
+$(OBJ1): $(INC1)
+$(OBJ2): $(INC2)
+$(AOBJ): autocode
 
 $(DESTLIB)/libohana.a: $(LIB)/libohana.$(ARCH).a
@@ -63,11 +70,9 @@
 	cp $(LIB)/libohana.$(ARCH).a $(DESTLIB)/libohana.a
 
-$(LIB)/libohana.$(ARCH).a: autocode $(HOBJ) $(LOBJ)
+$(LIB)/libohana.$(ARCH).a: autocode $(OBJ1) $(AOBJ) $(OBJ2)
 	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
 	rm -f $(LIB)/libohana.$(ARCH).a
-	ar rcv $(LIB)/libohana.$(ARCH).a $(LOBJ) $(AOBJ)
+	ar rcv $(LIB)/libohana.$(ARCH).a $(OBJ1) $(AOBJ) $(OBJ2)
 	$(RANLIB) $(LIB)/libohana.$(ARCH).a
-
-$(LOBJ): $(DESTINC)/ohana.h $(DESTINC)/loneos.h $(DESTINC)/elixir.h $(DESTINC)/panstarrs.h
 
 $(DESTINC)/%: $(INC)/%
@@ -88,3 +93,4 @@
 
 .c.$(ARCH).o:
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CFLAGS) -c $*.c -o $@
+	@echo done with $*.o
