summaryrefslogtreecommitdiff
path: root/source4/heimdal_build/asn1_deps.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-03 05:28:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:04 -0500
commit7facdcc161b75c7a3a85a0f6380f5b83394183c4 (patch)
treee14c0fb17019471f0c67b0d8a323a9809983043e /source4/heimdal_build/asn1_deps.pl
parent4fd6c8e9cfc69821f574f30f8e6c1eaa781594fc (diff)
downloadsamba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.tar.gz
samba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.tar.bz2
samba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.zip
r8985: Automatically generate make dependency rules for
the asn1 and error table files. This removes the need for HEIMDAL_EXTERNAL (This used to be commit 2f481ac93c0151b82dab737d49ae8d0d3cbbbbbe)
Diffstat (limited to 'source4/heimdal_build/asn1_deps.pl')
-rwxr-xr-xsource4/heimdal_build/asn1_deps.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/source4/heimdal_build/asn1_deps.pl b/source4/heimdal_build/asn1_deps.pl
new file mode 100755
index 0000000000..4cff3e2fae
--- /dev/null
+++ b/source4/heimdal_build/asn1_deps.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# Generate make dependency rules for asn1 files
+# Jelmer Vernooij <jelmer@samba.org> 2005
+# GPL
+
+use File::Basename;
+
+my $file = shift;
+my $prefix = shift;
+
+if (not defined ($prefix)) { $prefix = "asn1"; }
+
+$dirname = dirname($file);
+$basename = basename($file);
+
+my $header = "$dirname/$prefix.h";
+
+print "$header: $file bin/asn1_compile\n";
+print "\t\@echo \"Compiling ASN1 file $file\"\n";
+print "\t\@cd $dirname && ../../../bin/asn1_compile $basename $prefix\n\n";
+
+open(IN,$file) or die("Can't open $file: $!");
+foreach(<IN>) {
+ if (/^([A-Za-z0-9_-]+)[ \t]*::= /) {
+ my $output = $1;
+ $output =~ s/-/_/g;
+ print "$dirname/asn1_$output.c: $header\n";
+ print "\t\@mv $dirname/asn1_$output.x $dirname/asn1_$output.c\n\n";
+ }
+}
+close(IN);