Skip to content

Commit fd20308

Browse files
committed
Update freestnd-c-hdrs, seabios submodules
Also avoid some code repetition in the makefile
1 parent 7a5daf2 commit fd20308

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

GNUmakefile

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ endif
2020
# Default user QEMU flags. These are appended to the QEMU command calls.
2121
QEMUFLAGS := -m 2G
2222

23+
# User controllable host C compiler.
24+
HOST_CC := cc
25+
2326
# User controllable toolchain and toolchain prefix.
2427
TOOLCHAIN :=
2528
TOOLCHAIN_PREFIX :=
@@ -77,6 +80,20 @@ override USER_CFLAGS := $(CFLAGS)
7780
override USER_CPPFLAGS := $(CPPFLAGS)
7881
override USER_LDFLAGS := $(LDFLAGS)
7982

83+
override define SEABIOS_CALL =
84+
$(MAKE) -C seabios $(1) \
85+
HOSTCC="$(HOST_CC)" \
86+
CC="$(CC)" \
87+
LD="$(LD)" \
88+
OBJCOPY="$(OBJCOPY)" \
89+
OBJDUMP="$(OBJDUMP)" \
90+
STRIP="$(STRIP)" \
91+
CFLAGS="$(USER_CFLAGS)" \
92+
CPPFLAGS="$(USER_CPPFLAGS)" \
93+
LDFLAGS="$(USER_LDFLAGS)" \
94+
EXTRAVERSION=\"$(SEABIOS_EXTRAVERSION)\"
95+
endef
96+
8097
# Internal C flags that should not be changed by the user.
8198
override CFLAGS += \
8299
-Wall \
@@ -99,7 +116,7 @@ override CPPFLAGS := \
99116
-I uACPI/include \
100117
-DUACPI_OVERRIDE_CONFIG \
101118
-DBUILD_VERSION=\"$(BUILD_VERSION)\" \
102-
-isystem freestnd-c-hdrs \
119+
-isystem freestnd-c-hdrs/include \
103120
$(CPPFLAGS) \
104121
-MMD \
105122
-MP
@@ -261,13 +278,13 @@ endif
261278
# Remove object files and the final executable.
262279
.PHONY: clean
263280
clean: seabios/.config
264-
$(MAKE) -C seabios clean
281+
$(call SEABIOS_CALL,clean)
265282
rm -rf bin-$(ARCH) obj-$(ARCH)
266283

267284
# Remove everything built and generated including downloaded dependencies.
268285
.PHONY: distclean
269286
distclean: seabios/.config
270-
$(MAKE) -C seabios distclean
287+
$(call SEABIOS_CALL,distclean)
271288
rm -rf src/bins
272289
rm -rf bin-* obj-* ovmf
273290

@@ -287,16 +304,7 @@ uninstall:
287304
SEABIOS_EXTRAVERSION := -CSMWrap-$(BUILD_VERSION)
288305
.PHONY: seabios
289306
seabios: seabios/.config
290-
$(MAKE) -C seabios \
291-
CC="$(CC)" \
292-
LD="$(LD)" \
293-
OBJCOPY="$(OBJCOPY)" \
294-
OBJDUMP="$(OBJDUMP)" \
295-
STRIP="$(STRIP)" \
296-
CFLAGS="$(USER_CFLAGS)" \
297-
CPPFLAGS="$(USER_CPPFLAGS)" \
298-
LDFLAGS="$(USER_LDFLAGS)" \
299-
EXTRAVERSION=\"$(SEABIOS_EXTRAVERSION)\"
307+
$(call SEABIOS_CALL,)
300308

301309
src/bins/Csm16.h: GNUmakefile seabios/out/Csm16.bin
302310
mkdir -p src/bins
@@ -308,13 +316,4 @@ src/bins/vgabios.h: GNUmakefile seabios/out/vgabios.bin
308316

309317
seabios/.config: GNUmakefile seabios-config
310318
cp seabios-config seabios/.config
311-
$(MAKE) -C seabios olddefconfig \
312-
CC="$(CC)" \
313-
LD="$(LD)" \
314-
OBJCOPY="$(OBJCOPY)" \
315-
OBJDUMP="$(OBJDUMP)" \
316-
STRIP="$(STRIP)" \
317-
CFLAGS="$(USER_CFLAGS)" \
318-
CPPFLAGS="$(USER_CPPFLAGS)" \
319-
LDFLAGS="$(USER_LDFLAGS)" \
320-
EXTRAVERSION=\"$(SEABIOS_EXTRAVERSION)\"
319+
$(call SEABIOS_CALL,olddefconfig)

freestnd-c-hdrs

Submodule freestnd-c-hdrs updated from a87c192 to 5e4e9e7

0 commit comments

Comments
 (0)