Browse Source

[build] Construct all-drivers list based on driver class

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>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
dc19e630cb
4 changed files with 11 additions and 4 deletions
  1. 8
    1
      src/Makefile.housekeeping
  2. 1
    1
      src/arch/x86/Makefile
  3. 1
    1
      src/arch/x86/Makefile.efi
  4. 1
    1
      src/util/parserom.pl

+ 8
- 1
src/Makefile.housekeeping View File

915
 #
915
 #
916
 bobjs :
916
 bobjs :
917
 	@$(ECHO) $(BOBJS)
917
 	@$(ECHO) $(BOBJS)
918
+drivers_% :
919
+	@$(ECHO) $(DRIVERS_$*)
918
 drivers :
920
 drivers :
919
 	@$(ECHO) $(DRIVERS)
921
 	@$(ECHO) $(DRIVERS)
920
 .PHONY : drivers
922
 .PHONY : drivers
945
 	@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
947
 	@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
946
 CLEANUP		+= $(BIN)/NIC	# Doesn't match the $(BIN)/*.* pattern
948
 CLEANUP		+= $(BIN)/NIC	# Doesn't match the $(BIN)/*.* pattern
947
 
949
 
950
+# Select drivers to be included in the all-drivers build
951
+#
952
+DRIVERS		= $(DRIVERS_net) $(DRIVERS_infiniband) \
953
+		  $(DRIVERS_xen) $(DRIVERS_hyperv)
954
+DRIVERS_ipxe	= $(DRIVERS)
955
+
948
 # Analyse a target name (e.g. "bin/dfe538--prism2_pci.rom.tmp") and
956
 # Analyse a target name (e.g. "bin/dfe538--prism2_pci.rom.tmp") and
949
 # derive the variables:
957
 # derive the variables:
950
 # 
958
 # 
953
 # TGT_DRIVERS  : the driver for each element (e.g. "rtl8139 prism2_pci")
961
 # TGT_DRIVERS  : the driver for each element (e.g. "rtl8139 prism2_pci")
954
 # TGT_ROM_NAME : the ROM name (e.g. "dfe538")
962
 # TGT_ROM_NAME : the ROM name (e.g. "dfe538")
955
 #
963
 #
956
-DRIVERS_ipxe	= $(DRIVERS)
957
 CARD_DRIVER	= $(firstword $(DRIVER_$(1)) $(1))
964
 CARD_DRIVER	= $(firstword $(DRIVER_$(1)) $(1))
958
 TGT_ELEMENTS	= $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
965
 TGT_ELEMENTS	= $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
959
 TGT_ROM_NAME	= $(firstword $(TGT_ELEMENTS))
966
 TGT_ROM_NAME	= $(firstword $(TGT_ELEMENTS))

+ 1
- 1
src/arch/x86/Makefile View File

19
 
19
 
20
 # Include Hyper-V driver in the all-drivers build
20
 # Include Hyper-V driver in the all-drivers build
21
 #
21
 #
22
-DRIVERS += hyperv
22
+DRIVERS_hyperv += hyperv

+ 1
- 1
src/arch/x86/Makefile.efi View File

17
 
17
 
18
 # Include SNP driver in the all-drivers build
18
 # Include SNP driver in the all-drivers build
19
 #
19
 #
20
-DRIVERS += snp
20
+DRIVERS_net += snp
21
 
21
 
22
 # Rules for building EFI files
22
 # Rules for building EFI files
23
 #
23
 #

+ 1
- 1
src/util/parserom.pl View File

161
     unless ( $state->{'is_header_printed'} ) {
161
     unless ( $state->{'is_header_printed'} ) {
162
         print "# NIC\t\n";
162
         print "# NIC\t\n";
163
         print "# NIC\tfamily\t$state->{family}\n";
163
         print "# NIC\tfamily\t$state->{family}\n";
164
-        print "DRIVERS += $state->{driver_name}\n";
164
+        print "DRIVERS_$state->{driver_class} += $state->{driver_name}\n";
165
         print "\n";
165
         print "\n";
166
         $state->{'is_header_printed'} = 1;
166
         $state->{'is_header_printed'} = 1;
167
     }
167
     }

Loading…
Cancel
Save