# =============================================================================
# 
# @(#) Makefile,v SS7preBetaRelease(0.8) 2002/04/02 08:10:26
#
# -----------------------------------------------------------------------------
#
# Copyright (c) 2001  OpenSS7 Corporation <http://www.openss7.com>
# Copyright (c) 1997-2000  Brian F. G. Bidulock <bidulock@dallas.net>
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 675 Mass
# Ave, Cambridge, MA 02139, USA.
#
# -----------------------------------------------------------------------------
#
# U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software on
# behalf of the U.S. Government ("Government"), the following provisions apply
# to you.  If the Software is supplied by the Department of Defense ("DoD"), it
# is classified as "Commercial Computer Software" under paragraph 252.227-7014
# of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any
# successor regulations) and the Government is acquiring only the license rights
# granted herein (the license rights customarily provided to non-Government
# users).  If the Software is supplied to any unit or agency of the Government
# other than DoD, it is classified as "Restricted Computer Software" and the
# Government's rights in the Software are defined in paragraph 52.227-19 of the
# Federal Acquisition Regulations ("FAR") (or any success regulations) or, in
# the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR
# (or any successor regulations).
#
# -----------------------------------------------------------------------------
#
# Last Modified 2002/04/02 08:10:26 by brian
#
# =============================================================================

AW = $(wildcard *.aw)
AG = $(wildcard *.ag)
GI = $(AG:.ag=.gif)
HT = $(AW:.aw=_001.html)

FIG = $(wildcard *.fig)
MES = $(wildcard *.me)
TXT = $(MES:.me=.txt)
HTM = $(MES:.me=.html)
PSS = $(MES:.me=.ps)
PDF = $(MES:.me=.pdf)
PIC = $(FIG:.fig=.pic)
GIF = $(FIG:.fig=.gif)
EPS = $(FIG:.fig=.eps)

all:: $(PIC) $(TXT) $(PSS) $(PDF) $(HT) $(GT) $(PS) $(EPS) $(GIF) $(HT) $(GI)

gifs:: $(GI) $(GIF)
ps:: $(PS) $(EPS)
html:: $(HTML) $(GIF)

$(TXT) : %.txt : %.me ../idrefs ; groff -R -s -p -t -e -Tascii -me $< | ./../fixup > $@
$(HTM) : %.html: %.me ../idrefs ; groff -R -s -p -t -e -Thtml -me $< > $@
$(PSS) : %.ps  : %.me ../idrefs ; groff -R -s -p -t -e -Tps    -me $< > $@
$(PDF) : %.pdf : %.ps ../idrefs ; ps2pdf $< $@

$(PIC) : %.pic : %.fig ; fig2dev -L pic -p allps $< $@
$(GIF) : %.gif : %.fig ; fig2dev -L gif $< $@
$(EPS) : %.eps : %.fig ; fig2dev -L ps  $< $@

$(GI)  : %.gif : %.ag ; applix -quiet -add -call gifexport $< $@
$(PN)  : %.png : %.ag ; applix -quiet -add -call pngexport $< $@
$(HT)  : %_001.html : %.aw ; ../aw2h $<

txt:: $(TXT)
htm:: $(HTM)

clean::
	rm -f *.bak $(TXT) $(HTM) $(PSS) $(PDF) $(PIC) $(GIF) $(EPS) $(GI) $(HT) \
	$(AW:%.aw=%_*.html) \
	$(AW:%.aw=%_object*.ag)

%::
	
figs = $(wildcard datamodel.*.fig)
pics = $(figs:%.fig=%.pic)

datamodel.ps: $(pics)
