Skip to content

Commit f270c08

Browse files
committed
Better integration of SeaBIOS's build system into CSMWrap's
1 parent 0237b49 commit f270c08

File tree

5 files changed

+25
-13289
lines changed

5 files changed

+25
-13289
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
submodules: true
1515
- name: Install distro deps
1616
run: sudo apt-get install -y build-essential nasm
17-
- name: Rebuild SeaBIOS
18-
run: |
19-
make seabios
2017
- name: make x86_64
2118
run: |
2219
make ARCH=x86_64

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
/.cache
33
/boot
44
/ovmf
5+
/src/bins
56
/bin-*
67
/obj-*

GNUmakefile

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,15 @@ override HEADER_DEPS := $(addprefix obj-$(ARCH)/,$(CFILES:.c=.c.d) $(ASFILES:.S=
160160

161161
# Default target. This must come first, before header dependencies.
162162
.PHONY: all
163-
all: bin-$(ARCH)/$(OUTPUT).efi
163+
all:
164+
$(MAKE) seabios
165+
$(MAKE) bin-$(ARCH)/$(OUTPUT).efi
164166

165167
# Include header dependencies.
166168
-include $(HEADER_DEPS)
167169

170+
obj-$(ARCH)/src/csmwrap.c.o: src/bins/Csm16.h src/bins/vgabios.h
171+
168172
obj-$(ARCH)/src/printf.c.o: override CPPFLAGS += \
169173
-I nanoprintf
170174

@@ -238,21 +242,22 @@ endif
238242

239243
# Remove object files and the final executable.
240244
.PHONY: clean
241-
clean:
245+
clean: seabios/.config
246+
$(MAKE) -C seabios clean
242247
rm -rf bin-$(ARCH) obj-$(ARCH)
243248

244249
# Remove everything built and generated including downloaded dependencies.
245250
.PHONY: distclean
246-
distclean:
251+
distclean: seabios/.config
252+
$(MAKE) -C seabios distclean
253+
rm -rf src/bins
247254
rm -rf bin-* obj-* ovmf
248255

249256
# SeaBIOS build target.
250257
SEABIOS_EXTRAVERSION := -CSMWrap-$(BUILD_VERSION)
251258
.PHONY: seabios
252-
seabios:
253-
$(MAKE) -C seabios distclean
254-
cp seabios-config seabios/.config
255-
$(MAKE) -C seabios olddefconfig \
259+
seabios: seabios/.config
260+
$(MAKE) -C seabios \
256261
CC="$(CC)" \
257262
LD="$(LD)" \
258263
OBJCOPY="$(OBJCOPY)" \
@@ -262,7 +267,18 @@ seabios:
262267
CPPFLAGS="$(USER_CPPFLAGS)" \
263268
LDFLAGS="$(USER_LDFLAGS)" \
264269
EXTRAVERSION=\"$(SEABIOS_EXTRAVERSION)\"
265-
$(MAKE) -C seabios \
270+
271+
src/bins/Csm16.h: seabios/out/Csm16.bin
272+
mkdir -p src/bins
273+
cd seabios/out && xxd -i Csm16.bin >../../src/bins/Csm16.h
274+
275+
src/bins/vgabios.h: seabios/out/vgabios.bin
276+
mkdir -p src/bins
277+
cd seabios/out && xxd -i vgabios.bin >../../src/bins/vgabios.h
278+
279+
seabios/.config:
280+
cp seabios-config seabios/.config
281+
$(MAKE) -C seabios olddefconfig \
266282
CC="$(CC)" \
267283
LD="$(LD)" \
268284
OBJCOPY="$(OBJCOPY)" \
@@ -272,5 +288,3 @@ seabios:
272288
CPPFLAGS="$(USER_CPPFLAGS)" \
273289
LDFLAGS="$(USER_LDFLAGS)" \
274290
EXTRAVERSION=\"$(SEABIOS_EXTRAVERSION)\"
275-
cd seabios/out && xxd -i Csm16.bin >../../src/bins/Csm16.h
276-
cd seabios/out && xxd -i vgabios.bin >../../src/bins/vgabios.h

0 commit comments

Comments
 (0)