blob: e505c8c6b76918f89ad86acb9c06583e641a81fc [file] [log] [blame]
Stefan Reinauer33ee3ee2011-01-25 19:27:23 +00001TAG-$(CONFIG_SEABIOS_MASTER)=origin/master
Martin Kepplinger9c715962018-11-20 10:34:25 +01002TAG-$(CONFIG_SEABIOS_STABLE)=a698c8995ffb2838296ec284fe3c4ad33dfca307
Antonello Dettori3aa91dc2016-03-07 23:56:57 +00003TAG-$(CONFIG_SEABIOS_REVISION)=$(CONFIG_SEABIOS_REVISION_ID)
Peter Stugeb1d1c4d2011-02-07 20:16:40 +00004
Paul Menzel0cdaad32018-04-06 11:07:27 +02005project_git_repo=https://review.coreboot.org/seabios.git
Martin Rothae269c02016-03-16 12:42:05 -06006project_dir=seabios
7
Patrick Georgi3ee43172014-05-09 20:41:01 +02008unexport KCONFIG_AUTOHEADER
Peter Stugeb1d1c4d2011-02-07 20:16:40 +00009unexport KCONFIG_AUTOCONFIG
Patrick Georgi3ee43172014-05-09 20:41:01 +020010unexport KCONFIG_DEPENDENCIES
11unexport KCONFIG_SPLITCONFIG
12unexport KCONFIG_TRISTATE
13unexport KCONFIG_NEGATIVES
Stefan Reinauerf1939bb2010-12-30 17:39:50 +000014
Cristian Măgherușan-Stanciua78d5722011-06-07 15:03:14 +020015all: build
Stefan Reinauerf1939bb2010-12-30 17:39:50 +000016
Idwer Volleringab11a6a92014-08-11 16:09:07 +020017seabios:
Cristian Măgherușan-Stanciua78d5722011-06-07 15:03:14 +020018 echo " Cloning SeaBIOS from Git"
Martin Rothae269c02016-03-16 12:42:05 -060019 git clone $(project_git_repo) $(project_dir)
Cristian Măgherușan-Stanciua78d5722011-06-07 15:03:14 +020020
Idwer Volleringab11a6a92014-08-11 16:09:07 +020021fetch: seabios
Antonello Dettori3aa91dc2016-03-07 23:56:57 +000022ifeq ($(TAG-y),)
23 echo "Error: The specified tag is invalid"
24ifeq ($(CONFIG_SEABIOS_REVISION),y)
25 echo "Error: There is no revision specified for SeaBIOS"
26 false
27endif
28 false
29endif
Martin Roth3f1abb82016-03-07 21:56:24 -070030 cd seabios; git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ] || \
31 [ "$(TAG-y)" = "origin/master" ]; then \
32 echo " Fetching new commits from the SeaBIOS git repo"; \
33 git fetch; fi
Cristian Măgherușan-Stanciua78d5722011-06-07 15:03:14 +020034
35checkout: fetch
36 echo " Checking out SeaBIOS revision $(TAG-y)"
Idwer Volleringab11a6a92014-08-11 16:09:07 +020037 cd seabios; git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
Peter Stugeb1d1c4d2011-02-07 20:16:40 +000038
39config: checkout
40 echo " CONFIG SeaBIOS $(TAG-y)"
Idwer Volleringab11a6a92014-08-11 16:09:07 +020041 echo "CONFIG_COREBOOT=y" > seabios/.config
Martin Rothf80331f2016-02-06 12:47:05 -070042ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy)
Idwer Volleringab11a6a92014-08-11 16:09:07 +020043 echo "CONFIG_DEBUG_SERIAL=y" >> seabios/.config
44 echo "CONFIG_DEBUG_SERIAL_PORT=$(CONFIG_TTYS0_BASE)" >> seabios/.config
Ricardo Ribalda Delgado77ced402017-01-03 11:56:22 +010045else ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250MEM)$(CONFIG_HUDSON_UART),yyy)
46 echo "CONFIG_DEBUG_SERIAL_MMIO=y" >> seabios/.config
47 echo "CONFIG_DEBUG_SERIAL_MEM_ADDRESS=0xFEDC6000" >> seabios/.config
Philipp Deppenwiesed8b41392017-11-29 16:58:05 +010048else ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_ENABLE_HSUART),yy)
49 echo "CONFIG_DEBUG_SERIAL_MMIO=y" >> seabios/.config
50 echo "CONFIG_DEBUG_SERIAL_MEM_ADDRESS=$(CONFIG_CONSOLE_UART_BASE_ADDRESS)" >> seabios/.config
51else ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250MEM_32),yy)
52 echo "CONFIG_DEBUG_SERIAL_MMIO=y" >> seabios/.config
53 echo "CONFIG_DEBUG_SERIAL_MEM_ADDRESS=$(CONFIG_CONSOLE_UART_BASE_ADDRESS)" >> seabios/.config
Martin Roth0d7f1332014-07-25 14:33:49 -060054else
Idwer Volleringab11a6a92014-08-11 16:09:07 +020055 echo "# CONFIG_DEBUG_SERIAL is not set" >> seabios/.config
Martin Roth0d7f1332014-07-25 14:33:49 -060056endif
Martin Roth97804522014-07-25 14:24:32 -060057ifneq ($(CONFIG_SEABIOS_THREAD_OPTIONROMS),y)
Idwer Volleringab11a6a92014-08-11 16:09:07 +020058 echo "# CONFIG_THREAD_OPTIONROMS is not set" >> seabios/.config
Martin Roth97804522014-07-25 14:24:32 -060059endif
Edward O'Callaghana296f9e2014-09-13 03:43:49 +100060ifeq ($(CONFIG_SEABIOS_VGA_COREBOOT),y)
61 echo "CONFIG_VGA_COREBOOT=y" >> seabios/.config
62 echo "CONFIG_BUILD_VGABIOS=y" >> seabios/.config
63endif
Martin Roth99d05c72015-11-28 15:44:34 -070064ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
65ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
66 cat $(CONFIG_PAYLOAD_CONFIGFILE) >> seabios/.config
67else
68 echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
69 false
70endif
71endif
Stefan Taunerc48d7912017-01-15 11:49:25 +010072ifneq ($(CONFIG_SEABIOS_DEBUG_LEVEL),-1)
73 echo "CONFIG_DEBUG_LEVEL=$(CONFIG_SEABIOS_DEBUG_LEVEL)" >> seabios/.config
74endif
75# This shows how to force a previously set .config option *off*
76# echo "# CONFIG_SMBIOS is not set" >> seabios/.config
Idwer Volleringab11a6a92014-08-11 16:09:07 +020077 $(MAKE) -C seabios olddefconfig OUT=out/
Peter Stugeb1d1c4d2011-02-07 20:16:40 +000078
Cristian Măgherușan-Stanciua78d5722011-06-07 15:03:14 +020079build: config
Peter Stugeb1d1c4d2011-02-07 20:16:40 +000080 echo " MAKE SeaBIOS $(TAG-y)"
Idwer Volleringab11a6a92014-08-11 16:09:07 +020081 $(MAKE) -C seabios OUT=out/
Stefan Reinauerf1939bb2010-12-30 17:39:50 +000082
83clean:
Martin Rothac833672015-06-24 19:43:17 -060084 test -d seabios/out && rm -rf seabios/out || exit 0
Stefan Reinauerf1939bb2010-12-30 17:39:50 +000085
86distclean:
Idwer Volleringab11a6a92014-08-11 16:09:07 +020087 rm -rf seabios
Stefan Reinauerf1939bb2010-12-30 17:39:50 +000088
Martin Rothae269c02016-03-16 12:42:05 -060089print-repo-info:
90 echo "$(project_git_repo) $(project_dir)"
91
92.PHONY: checkout config build clean distclean clone fetch print-repo-info