drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / payloads / external / iPXE / Makefile
blob7ec8126c977e0a0ada43538b4b65592d3381bf2d
1 ## SPDX-License-Identifier: GPL-2.0-only
3 # 2022.1 - Last commit of January 2022
4 # When updating, change the name both here and in payloads/external/iPXE/Kconfig
5 STABLE_COMMIT_ID=6ba671acd922ee046b257c5119b8a0f64d275473
7 TAG-$(CONFIG_IPXE_MASTER)=origin/master
8 TAG-$(CONFIG_IPXE_STABLE)=$(STABLE_COMMIT_ID)
10 project_name=iPXE
11 project_dir=ipxe
12 project_git_repo=https://git.ipxe.org/ipxe.git
14 all: build
16 $(project_dir):
17 echo " Cloning $(project_name) from Git"
18 git clone $(project_git_repo) $(project_dir)
20 fetch: $(project_dir)
21 cd $(project_dir); \
22 git show $(TAG-y) >/dev/null 2>&1 ; \
23 if [ $$? -ne 0 ] || [ "$(TAG-y)" = "origin/master" ]; then \
24 echo " Fetching new commits from the $(project_name) repo"; \
25 git fetch; \
28 checkout: fetch
29 echo " Checking out $(project_name) revision $(TAG-y)"
30 cd $(project_dir); \
31 git checkout master; \
32 git branch -D coreboot 2>/dev/null; \
33 git checkout -b coreboot $(TAG-y)
35 config: checkout
36 ifeq ($(CONSOLE_SERIAL),yy)
37 cp "$(project_dir)/src/config/console.h" "$(project_dir)/src/config/console.h.cb"
38 cp "$(project_dir)/src/config/serial.h" "$(project_dir)/src/config/serial.h.cb"
39 sed -i'' 's|//#define\s*CONSOLE_SERIAL.*|#define CONSOLE_SERIAL|' "$(project_dir)/src/config/console.h"
40 sed -i'' 's|#define\s*COMCONSOLE.*|#define COMCONSOLE $(IPXE_UART)|' "$(project_dir)/src/config/serial.h"
41 sed -i'' 's|#define\s*COMSPEED.*|#define COMSPEED $(CONFIG_TTYS0_BAUD)|' "$(project_dir)/src/config/serial.h"
42 endif
43 ifneq ($(filter y,$(CONFIG_HAS_SCRIPT) $(CONFIG_IPXE_NO_PROMPT)),)
44 cp "$(project_dir)/src/config/general.h" "$(project_dir)/src/config/general.h.cb"
45 endif
46 ifeq ($(CONFIG_HAS_SCRIPT),y)
47 sed -i'' 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "$(project_dir)/src/config/general.h"
48 endif
49 ifeq ($(CONFIG_IPXE_NO_PROMPT),y)
50 sed -i'' 's|#define\s*BANNER_TIMEOUT.*|#define BANNER_TIMEOUT 0|' "$(project_dir)/src/config/general.h"
51 endif
52 ifeq ($(CONFIG_IPXE_HAS_HTTPS),y)
53 sed -i'' 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "$(project_dir)/src/config/general.h"
54 endif
55 ifeq ($(CONFIG_IPXE_TRUST_CMD),y)
56 sed -i'' 's|.*IMAGE_TRUST_CMD|#define IMAGE_TRUST_CMD|g' "$(project_dir)/src/config/general.h"
57 endif
59 build: config $(CONFIG_SCRIPT)
60 ifeq ($(CONFIG_HAS_SCRIPT),y)
61 echo " MAKE $(project_name) $(TAG-y) EMBED=$(CONFIG_SCRIPT)"
62 $(MAKE) -C $(project_dir)/src bin/$(PXE_ROM_PCI_ID).rom EMBED=$(CONFIG_SCRIPT)
63 else
64 echo " MAKE $(project_name) $(TAG-y)"
65 $(MAKE) -C $(project_dir)/src bin/$(PXE_ROM_PCI_ID).rom
66 endif
67 cp $(project_dir)/src/bin/$(PXE_ROM_PCI_ID).rom $(project_dir)/ipxe.rom
68 ifeq ($(CONSOLE_SERIAL),yy)
69 cp "$(project_dir)/src/config/console.h.cb" "$(project_dir)/src/config/console.h"
70 cp "$(project_dir)/src/config/serial.h.cb" "$(project_dir)/src/config/serial.h"
71 endif
72 ifneq ($(filter y,$(CONFIG_HAS_SCRIPT) $(CONFIG_IPXE_NO_PROMPT)),)
73 cp "$(project_dir)/src/config/general.h.cb" "$(project_dir)/src/config/general.h"
74 endif
76 clean:
77 test -d $(project_dir) && $(MAKE) -C $(project_dir)/src veryclean || exit 0
78 rm -f $(project_dir)/ipxe.rom
80 distclean:
81 rm -rf $(project_dir)
83 .PHONY: all fetch config build clean distclean