# # Copyright (c) 1994, 1995, 1996 Gunther Schadow. 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. # # Roadmap on file name extensions: # # .txt the standard documents in Microsoft Word 5.0 files. # .tb the tables which were manually generated from appendix A. # .stb the tables which were automatically generated from the # chapters (incl. appendix C) # .ftb the tables containing the `field notes' # .pl Prolog files (here they contain the tables from .stb files) # .msg Prolog files containing definitions of the messages. # .fpl Prolog files containing the `field notes'. # # Generation process: # # Text Table Prolog # # .tb -----> .pl # .txt -----> .stb -----> .pl # .txt -----> .ftb -----> .fpl # .txt -----------------> .msg # TOPDIR = ../../.. ROOTDIR = ../.. HL7STDIR2_1 = $(HL7STDIR)/v2.1 HL7STEXT =.txt GENSRCS=$(shell ls -1 *$(HL7STEXT) 2>/dev/null) all: source source: links $(MAKE) hl7.pl links: sourceclean ln -s $(HL7STDIR2_1)/*$(HL7STEXT) . || true include $(TOPDIR)/GNUmakefile.inc TXTDIR = . TBDIR = ./tb DIFFDIR = ./Diff EXDIR = ./scripts PLDIR = ./pl PLRUN = $(TOPDIR)/gen/pl vpath %.tb $(TBDIR) vpath %.txt $(TXTDIR) vpath %.diff $(DIFFDIR) vpath %.pl $(PLDIR) PATH := .:$(PLRUN):scripts:$(PATH) SUBDIRS = CHPTXT = kap1.txt kap2.txt kap3.txt kap4.txt kap5.txt kap6.txt \ kap7.txt APPTXT = anh_c.txt ALLTXT = $(CHPTXT) $(APPTXT) ALLTB = data-elements.tb data-types.tb functional-areas.tb \ message-type.tb order-control.tb segment-ids.tb table-ids.tb \ table-values.tb ALLPLS = $(ALLTB:.tb=.pl) $(ALLTXT:.txt=.pl) $(ALLTXT:.txt=.msg) \ $(ALLTXT:.txt=.fpl) JUNK += $(ALLTXT:.txt=.stb) $(ALLTXT:.txt=.ftb) $(ALLPLS) \ chptbl.pl rhl7.pl CHECK Errors hl7 DISTJUNK += hl7.pl # # Explicite rules # hl7.pl: rhl7.pl db-check.pl db-inter.pl db-clean.pl db-head.pl $(PL_CMD) -f $(PLDIR)/db-clean.pl -t cleanup cp $(PLDIR)/db-head.pl $@ sort hl7 |uniq |sed -e "s/[_A-Z][_A-Z0-9]*/_/g" >> $@ rm hl7 rhl7.pl: db-rawhead.pl $(ALLPLS) cat $^ > $@ chptbl.pl: $(CHPTXT) $(EXDIR)/chptbl $^ > chptbl.pl Errors: $(ALLPLS) for i in $(ALLPLS); \ do \ $(PL_CMD) -f $$i -t halt; \ done >$@ 2>&1 CHECK: rhl7.pl db-check.pl chptbl.pl $(PL_CMD) -f ./pl/db-check.pl -t hl7check 2>&1 |tee CHECK CHECK.pl-tex: CHECK $(EXDIR)/pl2tex CHECK > $@ hl7.dvi: CHECK.pl-tex rhl7.pl-tex hl7.tex tex hl7.tex # # Implicite rules # %.pl: %.tb $(EXDIR)/tb2pl $< > $@ %.stb: %.txt %.stb.diff $(EXDIR)/exseg $< > $@ patch -f -s -o $@ $@ $(DIFFDIR)/$(@F).diff rm -f $@.orig %.stb: %.txt $(EXDIR)/exseg $< > $@ %.pl: %.stb $(EXDIR)/tb2pl $< > $@ %.msg: %.txt awk -f $(EXDIR)/exmsg.awk $< > $@ %.ftb: %.txt awk -f $(EXDIR)/exfld $< > $@ %.fpl: %.ftb $(EXDIR)/tb2pl $< > $@ %.pl: %.pl-tex $(EXDIR)/pl2tex $< > $@ ### Do not change this line, make depend uses it! ###