From c096af2678070869026b78372d350b8f3bf62430 Mon Sep 17 00:00:00 2001 From: Mateusz Piasecki Date: Wed, 24 Sep 2025 10:45:41 +0200 Subject: [PATCH] Makefile: don't use all includes on host JIRA: ISC-286 --- Makefile.host | 14 ++++++++------ include_host/sys/rb.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) create mode 120000 include_host/sys/rb.h diff --git a/Makefile.host b/Makefile.host index 0d410a9e..a6bb43b6 100644 --- a/Makefile.host +++ b/Makefile.host @@ -1,7 +1,7 @@ # # Makefile for minimal libphoenix prepared for host # -# Copyright 2018-2021 Phoenix Systems +# Copyright 2018-2025 Phoenix Systems # # %LICENSE% # @@ -12,12 +12,12 @@ MAKEFLAGS += --no-print-directory include ../phoenix-rtos-build/Makefile.common # establish sysroot +INCLUDE_HOST := include_host LIBNAME := libphoenix.a -CFLAGS += -Iinclude -fno-builtin-malloc +CFLAGS := -I$(INCLUDE_HOST) -fno-builtin-malloc $(CFLAGS) -HEADERS := sys/rb.h -HEADERS := $(patsubst %,$(PREFIX_H)%,$(HEADERS)) +HEADERS := $(patsubst $(INCLUDE_HOST)%,$(PREFIX_H)%,$(shell find $(INCLUDE_HOST) -name '*.h' 2>/dev/null)) OBJS := sys/rb.o OBJS := $(patsubst %,$(PREFIX_O)%,$(OBJS)) @@ -27,8 +27,10 @@ all: $(PREFIX_A)$(LIBNAME) $(HEADERS) $(PREFIX_A)$(LIBNAME): $(OBJS) $(ARCH) -$(PREFIX_H)%.h: include/%.h - $(HEADER) +$(PREFIX_H)%.h: $(INCLUDE_HOST)/%.h + $(SIL)mkdir -p $(@D); \ + printf "HEADER %-24s\n" "$<"; \ + cp -pRL "$<" "$@" .PHONY: clean clean: diff --git a/include_host/sys/rb.h b/include_host/sys/rb.h new file mode 120000 index 00000000..7bc24225 --- /dev/null +++ b/include_host/sys/rb.h @@ -0,0 +1 @@ +../../include/sys/rb.h \ No newline at end of file