diff --git a/configure/RULES.Db b/configure/RULES.Db index 63b06dfed..b45e37049 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -239,8 +239,7 @@ menu%.h$(DEP): ../menu%.dbd %.dbd$(DEP): %.dbd.pod @$(RM) $@ - @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @echo "$(COMMONDEP_TARGET): ../Makefile" > $@ %.dbd$(DEP): %Include.dbd @$(RM) $@ @@ -281,6 +280,8 @@ menu%.h$(DEP): ../menu%.dbd @$(RM) $@ @$(ACFDEPENDS_CMD) +.PRECIOUS: %$(DEP) + ##################################################### CapFast filter $(COMMON_DIR)/%.edf: ../%.sch $(DEPSCHS) @@ -370,7 +371,7 @@ $(COMMON_DIR)/bpt%.dbd: bpt%.data $(COMMON_DIR)/%.dbd: %.dbd.pod @$(RM) $(notdir $@) - $(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $< + $(PERL) $(TOOLS)/podRemove.pl -o $(notdir $@) $< @$(MV) $(notdir $@) $@ $(COMMON_DIR)/%.dbd: %Include.dbd @@ -422,7 +423,7 @@ $$(INSTALL_DBD)/$$(notdir $(1)) : $(1) endef $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file)))) -.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%Include.dbd +.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%.dbd ##################################################### HTML files diff --git a/src/tools/Makefile b/src/tools/Makefile index 54115bc79..0e66e49c9 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -51,6 +51,7 @@ PERL_SCRIPTS += dbdToRecordtypeH.pl PERL_SCRIPTS += dbdExpand.pl PERL_SCRIPTS += dbdToHtml.pl PERL_SCRIPTS += podToHtml.pl +PERL_SCRIPTS += podRemove.pl PERL_SCRIPTS += registerRecordDeviceDriver.pl HTMLS = style.css diff --git a/src/tools/podRemove.pl b/src/tools/podRemove.pl new file mode 100644 index 000000000..c44f16a3d --- /dev/null +++ b/src/tools/podRemove.pl @@ -0,0 +1,49 @@ +#!/usr/bin/env perl +#************************************************************************* +# Copyright (c) 2015 UChicago Argonne LLC, as Operator of Argonne +# National Laboratory. +# EPICS BASE is distributed subject to a Software License Agreement found +# in file LICENSE that is included with this distribution. +#************************************************************************* + +# $Id$ + +use strict; +use warnings; + +use Getopt::Std; + +our ($opt_o); + +$Getopt::Std::OUTPUT_HELP_VERSION = 1; +&HELP_MESSAGE if !getopts('o:') || @ARGV != 1; + +my $infile = shift @ARGV; + +if (!$opt_o) { + ($opt_o = $infile) =~ s/\.pod$//; + $opt_o =~ s/^.*\///; +} + +open my $inp, '<', $infile or + die "podRemove.pl: Can't open $infile: $!\n"; +open my $out, '>', $opt_o or + die "podRemove.pl: Can't create $opt_o: $!\n"; + +my $inPod = 0; +while (<$inp>) { + if (m/\A=[a-zA-Z]/) { + $inPod = !m/\A=cut/; + } + else { + print $out $_ unless $inPod; + } +} + +close $out; +close $inp; + +sub HELP_MESSAGE { + print STDERR "Usage: podRemove.pl [-o file] file.pod\n"; + exit 2; +}