# # 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: # # .1 the standard documents in Microsoft WinWord 6.0 files # (though ASCII.CRs mapped to ASCII.LFs.) # .tb the tables which were derived from Access Databases # .pl Prolog files (here they contain the tables from .tb files) # .msg Prolog files containing definitions of the messages. # .tpl Prolog files containing the table headers. # # Generation process: # # Text Table Prolog # # .tb -----> .pl # .txt -----------------> .tpl /* tables pl */ # .txt -----------------> .mpl /* messages pl */ # TOPDIR = ../../.. ROOTDIR = ../.. HL7STDIR2_2 = $(HL7STDIR)/v2.2 ifndef HL7STEXT HL7STEXT=.doc endif ifndef HL7CHP HL7CHP=hl7chp endif ifndef HL7APP HL7APP=hl7app endif GENSRCS= $(ALLTXT) SUBDIRS = TXTDIR = . TBDIR = ./tb DIFFDIR = ./Diff EXDIR = ./scripts PLDIR = ./pl PLRUN = $(TOPDIR)/gen/pl vpath %.tb $(TBDIR) vpath %.1 $(TXTDIR) vpath %.diff $(DIFFDIR) vpath %.pl $(PLDIR) PATH := .:$(PLRUN):scripts:$(PATH) CHPTXT = $(HL7CHP)1.1 $(HL7CHP)2.1 $(HL7CHP)3.1 $(HL7CHP)4.1 \ $(HL7CHP)5.1 $(HL7CHP)6.1 $(HL7CHP)7.1 $(HL7CHP)8.1 APPTXT = $(HL7APP)c.1 ALLTXT = $(CHPTXT) $(APPTXT) ALLTB = segments.tb fields.tb nmt-fields.tb values.tb unused-tables.tb \ functional-areas.tb data-types.tb ALLTBPLS= $(ALLTB:.tb=.pl) ALLTPLS = $(ALLTXT:.1=.tpl) ALLMPLS = $(ALLTXT:.1=.mpl) ALLPLS = $(ALLTBPLS) $(ALLTPLS) $(ALLMPLS) JUNK += $(ALLPLS) rhl7.pl CHECK Errors hl7 DISTJUNK += hl7.pl all: source source: docs $(MAKE) hl7.pl docs: $(ALLTXT) gensrcs: hl7.pl include $(TOPDIR)/GNUmakefile.inc # # Explicite rules # alltbpls: $(ALLTBPLS) alltpls: $(ALLTPLS) allmpls: $(ALLMPLS) allpls: $(ALLPLS) $(ROOTDIR)/standard/$(VERSION)/hl7.pl: hl7.pl 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 $^ > $@ Errors: $(ALLPLS) for i in $(ALLPLS); \ do \ $(PL_CMD) -f $$i -t halt; \ done >$@ 2>&1 CHECK:: rhl7.pl db-check.pl $(PL_CMD) -f ./pl/db-check.pl -t hl7check 2>&1 |tee CHECK %.1: $(HL7STDIR2_2)/%$(HL7STEXT) cat $< |tr "\015" "\012" > $@ dings: echo $(HL7STDIR2_2)/%$(HL7STEXT) # # Implicite rules # %.pl: %.tb $(EXDIR)/tb2pl $(EXDIR)/tb2pl $< > $@ %.tpl: %.1 $(EXDIR)/extbl $(EXDIR)/extbl $< > $@ %.mpl: %.1 $(EXDIR)/exmsg.awk $(AWK) -f $(EXDIR)/exmsg.awk $< > $@ ### Do not change this line, make depend uses it! ###