2 # Generate make dependency rules for asn1 files
3 # Jelmer Vernooij <jelmer@samba.org> 2005
11 my $options = join(' ', @ARGV);
19 $basename = basename($file);
20 if (not defined $options) {
24 my $header = "$dirname/$prefix.h";
26 print "$header: $file bin/asn1_compile\n";
27 print "\t\@echo \"Compiling ASN1 file $file\"\n";
28 print "\t\@\$(builddir)/heimdal_build/asn1_compile_wrapper.sh \$(srcdir) \$(builddir) $dirname bin/asn1_compile $file $prefix $options\n\n";
30 open(IN,$file) or die("Can't open $file: $!");
32 if (/^([\w]+[\w\-]+)(\s+OBJECT IDENTIFIER)?\s*::=/) {
35 $c_file = "$dirname/asn1_$output.c";
36 $x_file = "$dirname/asn1_$output.x";
37 $o_file = "$dirname/asn1_$output.o";
38 print "$x_file: $header\n";
39 print "$c_file: $dirname/asn1_$output.x\n";
40 print "\t\@cp $x_file $c_file\n\n";
41 push @x_files, $x_file;
42 push @c_files, $c_file;
43 push @o_files, $o_file;
48 print '[SUBSYSTEM::HEIMDAL_'.uc($prefix).']'."\n";
49 print "CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -I$dirname\n";
51 foreach $o_file (@o_files) {
52 print "\\\n\t$o_file";
54 print "\nPRIVATE_DEPENDENCIES = HEIMDAL_ASN1\n\n";
57 print "\t\@echo \"Deleting ASN1 output files generated from $file\"\n";
58 print "\t\@rm -f $header\n";
59 foreach $c_file (@c_files) {
60 print "\t\@rm -f $c_file\n";
62 foreach $x_file (@x_files) {
63 print "\t\@rm -f $x_file\n";
65 print "\t\@rm -f $dirname/$prefix\_files\n";
66 print "\t\@rm -f $dirname/$prefix\.h\n";