Pārlūkot izejas kodu

[efi] Centralise architecture-independent EFI Makefile and linker script

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 gadus atpakaļ
vecāks
revīzija
a8037ee131
3 mainītis faili ar 49 papildinājumiem un 43 dzēšanām
  1. 46
    0
      src/Makefile.efi
  2. 3
    43
      src/arch/x86/Makefile.efi
  3. 0
    0
      src/scripts/efi.lds

+ 46
- 0
src/Makefile.efi Parādīt failu

@@ -0,0 +1,46 @@
1
+# -*- makefile -*- : Force emacs to use Makefile mode
2
+
3
+# The EFI linker script
4
+#
5
+LDSCRIPT	= scripts/efi.lds
6
+
7
+# Retain relocation information for elf2efi
8
+#
9
+LDFLAGS		+= -q -S
10
+
11
+# Media types.
12
+#
13
+NON_AUTO_MEDIA	+= efi
14
+NON_AUTO_MEDIA	+= efidrv
15
+NON_AUTO_MEDIA	+= drv.efi
16
+NON_AUTO_MEDIA	+= efirom
17
+
18
+# Include SNP driver in the all-drivers build
19
+#
20
+DRIVERS_net += snp
21
+
22
+# Rules for building EFI files
23
+#
24
+$(BIN)/%.efi : $(BIN)/%.efi.tmp $(ELF2EFI)
25
+	$(QM)$(ECHO) "  [FINISH] $@"
26
+	$(Q)$(ELF2EFI) --subsystem=10 $< $@
27
+
28
+$(BIN)/%.efidrv : $(BIN)/%.efidrv.tmp $(ELF2EFI)
29
+	$(QM)$(ECHO) "  [FINISH] $@"
30
+	$(Q)$(ELF2EFI) --subsystem=11 $< $@
31
+
32
+$(BIN)/%.drv.efi : $(BIN)/%.efidrv
33
+	$(QM)$(ECHO) "  [FINISH] $@"
34
+	$(Q)$(CP) $< $@
35
+
36
+$(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM)
37
+	$(QM)$(ECHO) "  [FINISH] $@"
38
+	$(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) $< $@
39
+
40
+$(BIN)/efidrv.cab : $(BIN)/alldrv.efis # $(ALL_drv.efi) is not yet defined
41
+	$(QM)$(ECHO) "  [CAB] $@"
42
+	$(Q)$(LCAB) -n -q $(ALL_drv.efi) $@
43
+
44
+$(BIN)/%.usb : $(BIN)/%.efi
45
+	$(QM)$(ECHO) "  [GENEFIDSK] $@"
46
+	$(Q)bash util/genefidsk -o $@ -b $(EFI_BOOT_FILE) $<

+ 3
- 43
src/arch/x86/Makefile.efi Parādīt failu

@@ -1,46 +1,6 @@
1 1
 # -*- makefile -*- : Force emacs to use Makefile mode
2 2
 
3
-# The EFI linker script
3
+# Include generic EFI Makefile
4 4
 #
5
-LDSCRIPT	= arch/x86/scripts/efi.lds
6
-
7
-# Retain relocation information for elf2efi
8
-#
9
-LDFLAGS		+= -q -S
10
-
11
-# Media types.
12
-#
13
-NON_AUTO_MEDIA	+= efi
14
-NON_AUTO_MEDIA	+= efidrv
15
-NON_AUTO_MEDIA	+= drv.efi
16
-NON_AUTO_MEDIA	+= efirom
17
-
18
-# Include SNP driver in the all-drivers build
19
-#
20
-DRIVERS_net += snp
21
-
22
-# Rules for building EFI files
23
-#
24
-$(BIN)/%.efi : $(BIN)/%.efi.tmp $(ELF2EFI)
25
-	$(QM)$(ECHO) "  [FINISH] $@"
26
-	$(Q)$(ELF2EFI) --subsystem=10 $< $@
27
-
28
-$(BIN)/%.efidrv : $(BIN)/%.efidrv.tmp $(ELF2EFI)
29
-	$(QM)$(ECHO) "  [FINISH] $@"
30
-	$(Q)$(ELF2EFI) --subsystem=11 $< $@
31
-
32
-$(BIN)/%.drv.efi : $(BIN)/%.efidrv
33
-	$(QM)$(ECHO) "  [FINISH] $@"
34
-	$(Q)$(CP) $< $@
35
-
36
-$(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM)
37
-	$(QM)$(ECHO) "  [FINISH] $@"
38
-	$(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) $< $@
39
-
40
-$(BIN)/efidrv.cab : $(BIN)/alldrv.efis # $(ALL_drv.efi) is not yet defined
41
-	$(QM)$(ECHO) "  [CAB] $@"
42
-	$(Q)$(LCAB) -n -q $(ALL_drv.efi) $@
43
-
44
-$(BIN)/%.usb : $(BIN)/%.efi
45
-	$(QM)$(ECHO) "  [GENEFIDSK] $@"
46
-	$(Q)bash util/genefidsk -o $@ -b $(EFI_BOOT_FILE) $<
5
+MAKEDEPS	+= Makefile.efi
6
+include Makefile.efi

src/arch/x86/scripts/efi.lds → src/scripts/efi.lds Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt