]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Construct all-drivers list based on driver class
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Apr 2015 11:14:16 +0000 (12:14 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Apr 2015 11:21:14 +0000 (12:21 +0100)
The USB bus drivers (ehci.c and xhci.c) have PCI device ID tables and
hence PCI_ROM() lines, but should probably not be included in the
all-drivers build on this basis, since they do nothing useful unless a
USB network driver is also present.

Fix by constructing the all-drivers list based on the driver class
(i.e. the portion of the source path immediately after "drivers/").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping
src/arch/x86/Makefile
src/arch/x86/Makefile.efi
src/util/parserom.pl

index 51d71f1343eafc78fdcf1d62e7b2b62fcd7d5e7d..be9ad7c4150f6f6988bb166bc52c8b33864853a1 100644 (file)
@@ -915,6 +915,8 @@ BOBJS       += $(patsubst %,$(BIN)/%.ids.o,$(DRIVERS))
 #
 bobjs :
        @$(ECHO) $(BOBJS)
+drivers_% :
+       @$(ECHO) $(DRIVERS_$*)
 drivers :
        @$(ECHO) $(DRIVERS)
 .PHONY : drivers
@@ -945,6 +947,12 @@ $(BIN)/NIC : $(AUTO_DEPS)
        @perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
 CLEANUP                += $(BIN)/NIC   # Doesn't match the $(BIN)/*.* pattern
 
+# Select drivers to be included in the all-drivers build
+#
+DRIVERS                = $(DRIVERS_net) $(DRIVERS_infiniband) \
+                 $(DRIVERS_xen) $(DRIVERS_hyperv)
+DRIVERS_ipxe   = $(DRIVERS)
+
 # Analyse a target name (e.g. "bin/dfe538--prism2_pci.rom.tmp") and
 # derive the variables:
 # 
@@ -953,7 +961,6 @@ CLEANUP             += $(BIN)/NIC   # Doesn't match the $(BIN)/*.* pattern
 # TGT_DRIVERS  : the driver for each element (e.g. "rtl8139 prism2_pci")
 # TGT_ROM_NAME : the ROM name (e.g. "dfe538")
 #
-DRIVERS_ipxe   = $(DRIVERS)
 CARD_DRIVER    = $(firstword $(DRIVER_$(1)) $(1))
 TGT_ELEMENTS   = $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
 TGT_ROM_NAME   = $(firstword $(TGT_ELEMENTS))
index 1751c0cda6294b94ac8641111efdd279f469af0d..98c49b98d90f0587cd80d978ee210bf89e1335b7 100644 (file)
@@ -19,4 +19,4 @@ CFLAGS                += -DNVALGRIND
 
 # Include Hyper-V driver in the all-drivers build
 #
-DRIVERS += hyperv
+DRIVERS_hyperv += hyperv
index 13a69d9f7f128f54dc98cdf803727c13ffda5d29..f73bc7d5dc4c53e796fc95226aca563fd1124ebf 100644 (file)
@@ -17,7 +17,7 @@ NON_AUTO_MEDIA        += efirom
 
 # Include SNP driver in the all-drivers build
 #
-DRIVERS += snp
+DRIVERS_net += snp
 
 # Rules for building EFI files
 #
index 678e5c812d58f84bec47648babd1deeafb471735..2c59f4863146a482c6cdf8ecdaead036cfaa5d7d 100755 (executable)
@@ -161,7 +161,7 @@ sub print_make_rules {
     unless ( $state->{'is_header_printed'} ) {
         print "# NIC\t\n";
         print "# NIC\tfamily\t$state->{family}\n";
-        print "DRIVERS += $state->{driver_name}\n";
+        print "DRIVERS_$state->{driver_class} += $state->{driver_name}\n";
         print "\n";
         $state->{'is_header_printed'} = 1;
     }