Selaa lähdekoodia

[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 vuotta sitten
vanhempi
commit
dc19e630cb
4 muutettua tiedostoa jossa 11 lisäystä ja 4 poistoa
  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 Näytä tiedosto

@@ -915,6 +915,8 @@ BOBJS	+= $(patsubst %,$(BIN)/%.ids.o,$(DRIVERS))
915 915
 #
916 916
 bobjs :
917 917
 	@$(ECHO) $(BOBJS)
918
+drivers_% :
919
+	@$(ECHO) $(DRIVERS_$*)
918 920
 drivers :
919 921
 	@$(ECHO) $(DRIVERS)
920 922
 .PHONY : drivers
@@ -945,6 +947,12 @@ $(BIN)/NIC : $(AUTO_DEPS)
945 947
 	@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
946 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 956
 # Analyse a target name (e.g. "bin/dfe538--prism2_pci.rom.tmp") and
949 957
 # derive the variables:
950 958
 # 
@@ -953,7 +961,6 @@ CLEANUP		+= $(BIN)/NIC	# Doesn't match the $(BIN)/*.* pattern
953 961
 # TGT_DRIVERS  : the driver for each element (e.g. "rtl8139 prism2_pci")
954 962
 # TGT_ROM_NAME : the ROM name (e.g. "dfe538")
955 963
 #
956
-DRIVERS_ipxe	= $(DRIVERS)
957 964
 CARD_DRIVER	= $(firstword $(DRIVER_$(1)) $(1))
958 965
 TGT_ELEMENTS	= $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
959 966
 TGT_ROM_NAME	= $(firstword $(TGT_ELEMENTS))

+ 1
- 1
src/arch/x86/Makefile Näytä tiedosto

@@ -19,4 +19,4 @@ CFLAGS		+= -DNVALGRIND
19 19
 
20 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 Näytä tiedosto

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

+ 1
- 1
src/util/parserom.pl Näytä tiedosto

@@ -161,7 +161,7 @@ sub print_make_rules {
161 161
     unless ( $state->{'is_header_printed'} ) {
162 162
         print "# NIC\t\n";
163 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 165
         print "\n";
166 166
         $state->{'is_header_printed'} = 1;
167 167
     }

Loading…
Peruuta
Tallenna