ifeq ($(HOSTTYPE), alpha)
  CXX  = cxx
endif
ifndef (CFITSIODIR)
  CFITSIODIR = ../cfitsio
endif
CPPFLAGS    =-O -g -I$(CFITSIODIR)

LDLIBS=-L$(CFITSIODIR)/$(HOSTTYPE) -lcfitsio

ifdef NOSHLIB
  ifeq ($(CXX), g++)
    LDFLAGS = -static
  endif
  ifeq ($(CXX), cxx)
    LDFLAGS = -non_shared
  endif
endif

default: archtoi

clean:
	rm -f archtoi *.o archdump


archtoi: archtoimain.o archtoi.o archeopsfile.o decompress.o toiiter.o toisvr.o archeops.o \
         ssthandler.o toiinterpolator.o gpsparser.o asigps.o \
         auxinterpgps.o tsid.o archparam.o dyffttools.o fft_mayer.o \
         formepulse.o pisteetoile.o sstetoile.o transfelec.o \
	 gyrohandler.o aa_hadec.o templocator.o plgalcross.o \
	 arcunit.o
	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ -lm 
archdump: archtoidump.o archeopsfile.o decompress.o archeops.o ssthandler.o
	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ -lm

