Skip to content

Commit

Permalink
filter-out WARN_CFLAGS from HOST_CFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Daniel committed Aug 19, 2023
1 parent b673408 commit 7431d8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ include sources/build/boards/$(ARCH)-$(BOARD)/build.mk
export LC_ALL=C

ifeq '$(TOOLCHAIN)' 'gnu'
BASE_CFLAGS += \
WARN_CFLAGS += \
-Wno-error=analyzer-out-of-bounds \
-Wno-error=analyzer-use-of-uninitialized-value \
-Wno-error=maybe-uninitialized
BASE_CFLAGS += $(WARN_CFLAGS)
endif

BASE_CFLAGS += \
Expand Down Expand Up @@ -62,7 +63,6 @@ include $(wildcard sources/utils/*/build.mk)
include build/toolchain/archs/$(ARCH)/arch.mk
-include build/toolchain/archs/$(HOST_ARCH)/host.mk
include build/toolchain/$(TOOLCHAIN)/build.mk

include sources/libs/.build.mk
include sources/build/kernel/build.mk
include sources/build/host/build.mk
Expand Down
6 changes: 4 additions & 2 deletions sources/build/host/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ LIBS_HOST_OBJ = \

LIBS_HOST_BIN=$(BINDIR_HOST)/libbrutal.a

NO_WARN_HOST_CFLAGS = $(filter-out $(WARN_CFLAGS), $(HOST_CFLAGS))

$(BINDIR_HOST)/%.c.o: sources/%.c | $(GENERATED_MOD)
@$(MKCWD)
$(HOST_CC) -c -o $@ $< $(HOST_CFLAGS)
$(HOST_CC) -c -o $@ $< $(NO_WARN_HOST_CFLAGS)

$(BINDIR_HOST)/%.s.o: sources/%.s
@$(MKCWD)
Expand Down Expand Up @@ -58,7 +60,7 @@ DEPENDENCIES += $$($(1)_HOST_OBJ:.o=.d)

$$($(1)_HOST_BIN): $$($(1)_HOST_OBJ) $(LIBS_HOST_BIN)
@$$(MKCWD)
$(HOST_CC) -o $$@ $$^ $(HOST_LDFLAGS) $(HOST_CFLAGS)
$(HOST_CC) -o $$@ $$^ $(HOST_LDFLAGS) $(NO_WARN_HOST_CFLAGS)

host-$$($(1)_NAME)-dump:
@echo "$$($(1)_HOST_BIN)"
Expand Down

0 comments on commit 7431d8c

Please sign in to comment.