CFLAGS= -g -O2 -DBYTE_REORDER -I$(IMC) -I$(MOSINC) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

IMC=imc
MOSLIB=lib
MOSINC=include
DETECT=meas
prefix=/data1/Data/SUBARU/SDFRED2
MOSBIN=${prefix}/bin/
SHELL=/bin/bash
PERLPATH=/usr/bin/perl
AWK=gawk
YWIDTH=1000


SUBDIRS=$(SUBDIRS1)
VERSION_STRING="\"20101205_mini\""

SUBDIRS = libsrc getarg imc match skysb smth util osmed starsel airmass

nothing:
	@echo If you want to build all, command 'make all'.
	@echo If you want to build and install, command 'make install'.

dummy:

$(SUBDIRS) : dummy
	@echo $@':' 
	if [ -f $@/Makefile.in -a -f $@/Makefile ] ; then (cd $@; $(MAKE)  IMC=../$(IMC) MOSLIB=../$(MOSLIB) MOSINC=../$(MOSINC) MOSBIN=$(MOSBIN) DETECT=../$(DETECT)) ; fi

all: $(SUBDIRS) 

install: 
	-if [ ! -d "$(MOSBIN)" ] ; then mkdir $(MOSBIN) ; fi
	for dir in $(SUBDIRS); do (cd $$dir; $(MAKE)  IMC=../$(IMC) MOSLIB=../$(MOSLIB) MOSBIN=$(MOSBIN) MOSINC=../$(MOSINC) DETECT=../$(DETECT) install) ; done

distclean: clean
	rm -f *~ *.o config.cache config.log config.status
	for dir in $(SUBDIRS) ; do if [ -f $$dir/Makefile.in -a -f $$dir/Makefile ] ;  then  (echo $$dir':'; cd $$dir; $(MAKE) distclean); rm -f $$dir/Makefile ; fi ; done
	if [ -d bin/ ] ; then rm -f bin/* ; fi
	if [ -d lib/ ] ; then rm -f lib/* ; fi
	if [ -d include/ ] ; then rm -f include/* ; fi
	rm -f ./Makefile 

clean: 
	for dir in $(SUBDIRS) ; do (echo $$dir':'; cd $$dir; $(MAKE) clean) ; done
