# $Id: Makefile,v 1.16 2006-01-16 01:11:40 eugene Exp $

PDFLATEX = env TEXINPUTS=.:LaTeX:$(TEXINPUTS): pdflatex
PSLATEX  = env TEXINPUTS=.:LaTeX:$(TEXINPUTS): latex

SUBDIRS = ps1.mission ps1.analysis ps1.datasystem ps1.calibration ps1.dataproducts ps1.detrend ps1.MDfields 

help:
	@echo "USAGE: make (target)"
	@echo "  targets: all ps1.release.pdf $(SUBDIRS)"

RELEASE = ps1.release.tex

ps1.release.pdf: $(RELEASE)

all:
	make ps1.release.pdf
	for i in $(SUBDIRS); do $(MAKE) $$i; done

$(SUBDIRS):
	@if [ -d "$@" ]; then \
	  echo -n -e "\0033]0; *** $@ *** \0007"; \
	  (cd $@ && $(MAKE) all); \
	fi

include Makefile.Common

all.clean:
	make clean
	for i in $(SUBDIRS); do $(MAKE) $$i.clean; done

all.dist:
	make dist
	for i in $(SUBDIRS); do $(MAKE) $$i.dist; done

%.clean:
	if [ -d "$*" ]; then (cd $* && $(MAKE) clean); fi

%.dist:
	if [ -d "$*" ]; then (cd $* && $(MAKE) dist); fi

.PHONY: $(SUBDIRS)
