coreboot/util/mec152x/Makefile
Maximilian Brune c5e905fa21 util/mec152x/Makefile: Include commonlib/bsd/compiler.h
cbfstool/flashmap/kv_pair.h uses the `__printf` macro. So we need to
include the header file defining `__printf` in the compilation.

The tooling can now be compiled on its own outside the coreboot build
system.

Change-Id: I5a622b50684c42773e66e6d9145d5de9858c9e9a
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91887
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2026-03-27 17:55:22 +00:00

55 lines
1.2 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-or-later
PRG := mec152xtool
TOP ?= $(abspath ../..)
ROOT := $(TOP)/src
CC ?= $(CROSS_COMPILE)gcc
HOSTCC ?= $(CC)
INSTALL ?= /usr/bin/env install
PREFIX ?= /usr/local
HOSTCFLAGS ?= $(CFLAGS)
HOSTCFLAGS += -Wall -Wextra -MMD -MP -O3
HOSTCFLAGS += -I $(TOP)/util/cbfstool/flashmap/
HOSTCFLAGS += -I $(ROOT)/commonlib/bsd/include
HOSTCFLAGS += -include $(TOP)/src/commonlib/bsd/include/commonlib/bsd/compiler.h
HOSTLDFLAGS ?= $(LDFLAGS)
# there files are in this directory
SRC := main.c utils.c rom.c
# and these are in $(TOP)/util/cbfstool/flashmap/
SRC += fmap.c kv_pair.c valstr.c
OBJ := $(SRC:.c=.o)
DEP := $(SRC:.c=.o.d)
.PHONY: all debug clean install
all: $(PRG)
debug: HOSTCFLAGS += -O0 -g
debug: HOSTLDFLAGS += -g
debug: all
install: $(PRG)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) $^ $(DESTDIR)$(PREFIX)/bin/
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/$(PRG)
clean:
$(RM) -f $(PRG) $(OBJ) $(DEP)
$(PRG): $(OBJ)
$(HOSTCC) -o $@ $^ $(HOSTLDFLAGS)
%.o: %.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ -MF $@.d $<
%.o: $(TOP)/util/cbfstool/flashmap/%.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ -MF $@.d $<
-include $(DEP)