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
)
12 project_git_repo
=https
://git.ipxe.org
/ipxe.git
17 echo
" Cloning $(project_name) from Git"
18 git clone
$(project_git_repo
) $(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"; \
29 echo
" Checking out $(project_name) revision $(TAG-y)"
31 git checkout master
; \
32 git branch
-D coreboot
2>/dev
/null
; \
33 git checkout
-b coreboot
$(TAG-y
)
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"
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"
46 ifeq ($(CONFIG_HAS_SCRIPT
),y
)
47 sed
-i
'' 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "$(project_dir)/src/config/general.h"
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"
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"
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"
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
)
64 echo
" MAKE $(project_name) $(TAG-y)"
65 $(MAKE
) -C
$(project_dir
)/src bin
/$(PXE_ROM_PCI_ID
).rom
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"
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"
77 test -d
$(project_dir
) && $(MAKE
) -C
$(project_dir
)/src veryclean || exit
0
78 rm -f
$(project_dir
)/ipxe.rom
83 .PHONY
: all fetch config build
clean distclean