include  $(COSMOSTOP)/site.config


EXTHDRS	      =

HDRS	      = Zatmos.h \
		Zcinippxc.h \
		Zcmain.h \
		Zcode.h \
		Zcondc.h \
		Zcoord.h \
		Zcoordtype.h \
		ZcosmosBD.h \
		ZdedxAir.h \
		Zdirec.h \
		Zearth.h \
		Zelemagp.h \
		Zenu1ry.h \
		Zevhnp.h \
		Zevhnv.h \
		Zglobalc.h \
		Zheavyc.h \
		Zheavyp.h \
		Zheavyv.h \
		ZincForNameL.h \
		Zincidentp.h \
		Zincidentv.h \
		Zkcele.h \
		Zkfcode.h \
		Zlife.h \
		Zmagfield.h \
		Zmagfieldtp.h \
		Zmanager.h \
		Zmanagerp.h \
		Zmass.h \
		Zmaxdef.h \
		Znamelist.h \
		Znamelist1.h \
		Znamelist2.h \
		Zobs.h \
		Zobsp.h \
		Zobsv.h \
		Zpos.h \
		Zprimary.h \
		Zprimaryc.h \
		Zprimaryv.h \
		Zptcl.h \
		Zreadonly.h \
		ZrigCut.h \
		ZsaveStruc.h \
		Zstackv.h \
		Zstdatmos.h \
		Zstdatmosf.h \
		ZstrangeCode.h \
		ZsubstRec.h \
		Ztrack.h \
		Ztrackp.h \
		Ztrackv.h \
		Zunionmap.h \
		Zxsectionp.h


MAKEFILE      = Makefile

OBJS	      =

PRINT	      = pr

SHELL	      = /bin/sh

SRCS	      =

SYSHDRS	      =

all:
	make	Checkdir $(LIBRARY) SeeSubDir "TARGET=$@"

clean:
	@rm -f $(OBJS) core  *~ a.out temp*.f
	make SeeSubDir "TARGET=$@"


clobber:
	@rm -f $(OBJS) $(LIBRARY) core tags
	make SeeSubDir "TARGET=$@"

depend:
	@mkmf -f $(MAKEFILE) ROOT=$(ROOT)
	make SeeSubDir "TARGET=$@"

echo:
	@echo $(HDRS) $(SRCS)
	make SeeSubDir "TARGET=$@"

extract:
	@ar x $(LIBRARY)


index:
	@ctags -wx $(HDRS) $(SRCS)
	make SeeSubDir "TARGET=$@"

install:	$(LIBRARY)
		@echo "****" Installing $(LIBRARY) into $(DEST)
		$(INSTALL) -f  $(DEST) $(LIBRARY)
		@echo "****" Installing Template files into $(TEMPLATE)
		cp -r  $(EPICSTOP)/Data  $(EPICSTOP)/Util \ 
		 $(EPICSTOP)/UserHook  $(EPICSTOP)/Scrpt  \
		 $(EPICSTOP)/Doc        $(TEMPLATE)/
		cp $(EPICSTOP)/site.config $(TEMPLATE)/
		@echo "****" Installing header files into $(HEADER)
		cp -r $(EPICSTOP)/epics  $(HEADER)/
		@echo "****" Installation ended.
		@echo "****" Owner and group should be changed by hand

print:
	@$(PRINT) $(HDRS) $(SRCS)
	make SeeSubDir "TARGET=$@"

tags:           $(HDRS) $(SRCS)
	@ctags $(HDRS) $(SRCS)
	make SeeSubDir "TARGET=$@"


Checkdir:
	@( cd $(EPICSTOP)/lib; if [ ! -d  $(ARCH) ]; then  mkdir $(ARCH); fi)


SeeSubDir:
	@for i in  * \
	;do   \
		if [ -d  $$i ] ; then \
			(cd $$i; \
			if [ -f Makefile  -a  $$i != Test \
			-a $$i != Util -a $$i != UC  \
	                -a $$i != Data  -a $$i != epics \
	                -a $$i != Obso  -a $$i != TeX \
	                -a $$i != lib  -a $$i != UserHook \
	                -a $$i != Scrpt -a $$i != DistJob ] ; then \
		            $(MAKE) $(TARGET) \
			;fi) \
		; fi \
	done


$(LIBRARY):         
