Commit 602beafe authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: clean up drivers/scsi firmware generation, part 1

Teach the perl script to accept output filenames on the command
lines, so we don't have to move the generated files afterwards 
(which isn't parallel make safe)
parent 161558fd
...@@ -133,9 +133,7 @@ include $(TOPDIR)/Rules.make ...@@ -133,9 +133,7 @@ include $(TOPDIR)/Rules.make
53c8xx_d.h: 53c7,8xx.scr script_asm.pl 53c8xx_d.h: 53c7,8xx.scr script_asm.pl
ln -sf 53c7,8xx.scr fake8.c ln -sf 53c7,8xx.scr fake8.c
$(CPP) $(CPPFLAGS) -traditional -DCHIP=810 fake8.c | grep -v '^#' | $(PERL) script_asm.pl $(CPP) $(CPPFLAGS) -traditional -DCHIP=810 fake8.c | grep -v '^#' | $(PERL) script_asm.pl $@ $(@:_d.h=_u.h)
mv script.h 53c8xx_d.h
mv scriptu.h 53c8xx_u.h
rm fake8.c rm fake8.c
53c8xx_u.h: 53c8xx_d.h 53c8xx_u.h: 53c8xx_d.h
...@@ -143,10 +141,8 @@ include $(TOPDIR)/Rules.make ...@@ -143,10 +141,8 @@ include $(TOPDIR)/Rules.make
53c7,8xx.o: 53c8xx_u.h 53c7,8xx.o: 53c8xx_u.h
53c7xx_d.h: 53c7xx.scr script_asm.pl 53c7xx_d.h: 53c7xx.scr script_asm.pl
ln -sf 53c7xx.scr fake7.c ln -sf $< fake7.c
$(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | $(PERL) -s script_asm.pl -ncr7x0_family $(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | $(PERL) -s script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h)
mv script.h 53c7xx_d.h
mv scriptu.h 53c7xx_u.h
rm fake7.c rm fake7.c
53c7xx_u.h: 53c7xx_d.h 53c7xx_u.h: 53c7xx_d.h
...@@ -154,10 +150,8 @@ include $(TOPDIR)/Rules.make ...@@ -154,10 +150,8 @@ include $(TOPDIR)/Rules.make
53c7xx.o : 53c7xx_d.h 53c7xx.o : 53c7xx_d.h
sim710_d.h: sim710.scr script_asm.pl sim710_d.h: sim710.scr script_asm.pl
ln -sf sim710.scr fake7.c ln -sf $< fake7.c
$(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | $(PERL) -s script_asm.pl -ncr7x0_family $(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | $(PERL) -s script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h)
mv script.h sim710_d.h
mv scriptu.h sim710_u.h
rm fake7.c rm fake7.c
sim710_u.h: sim710_d.h sim710_u.h: sim710_d.h
...@@ -165,8 +159,6 @@ sim710_u.h: sim710_d.h ...@@ -165,8 +159,6 @@ sim710_u.h: sim710_d.h
sim710.o : sim710_d.h sim710.o : sim710_d.h
53c700_d.h: 53c700.scr script_asm.pl 53c700_d.h: 53c700.scr script_asm.pl
$(PERL) -s script_asm.pl -ncr7x0_family < 53c700.scr $(PERL) -s script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h) < $<
rm -f scriptu.h
mv script.h 53c700_d.h
53c700.o: 53c700_d.h 53c700.o: 53c700_d.h
...@@ -53,7 +53,8 @@ $debug = 0; # Print general debugging messages ...@@ -53,7 +53,8 @@ $debug = 0; # Print general debugging messages
$debug_external = 0; # Print external/forward reference messages $debug_external = 0; # Print external/forward reference messages
$list_in_array = 1; # Emit original SCRIPTS assembler in comments in $list_in_array = 1; # Emit original SCRIPTS assembler in comments in
# script.h # script.h
$prefix = ''; # define all arrays having this prefix so we #$prefix; # (set by perl -s)
# define all arrays having this prefix so we
# don't have name space collisions after # don't have name space collisions after
# assembling this file in different ways for # assembling this file in different ways for
# different host adapters # different host adapters
...@@ -382,12 +383,10 @@ print STDERR "looking for data in $conditional\n" if ($debug); ...@@ -382,12 +383,10 @@ print STDERR "looking for data in $conditional\n" if ($debug);
} }
} }
# Parse command line # Parse command line
foreach $arg (@argv) { $output = shift;
if ($arg =~ /^-prefix\s*=\s*([_a-zA-Z][_a-zA-Z0-9]*)$/i) { $outputu = shift;
$prefix = $1
}
}
# Main loop # Main loop
while (<STDIN>) { while (<STDIN>) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment