Skip to content

Commit 6c49b0d

Browse files
authored
Merge pull request #128 from sysprog21/fix-build-system
Fix build system issues
2 parents 2e75289 + 52b5e35 commit 6c49b0d

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,15 @@ endif
177177

178178
CFLAGS += -include config.h
179179

180-
# Only include build rules when not running configuration targets
181-
ifeq ($(filter $(check_goal),config defconfig),)
182-
include mk/common.mk
180+
# Only skip build rules when running ONLY config/defconfig (no other targets)
181+
ifneq ($(filter-out config defconfig,$(check_goal)),)
182+
# Has targets other than config/defconfig
183+
include mk/common.mk
184+
else ifeq ($(check_goal),)
185+
# Empty goals means building 'all'
186+
include mk/common.mk
183187
endif
188+
# Otherwise, only config/defconfig targets - skip mk/common.mk
184189

185190
KCONFIGLIB := tools/kconfig/kconfiglib.py
186191
$(KCONFIGLIB):

configs/Kconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ config CONFIGURED
44
bool
55
default y
66

7-
# Dependency detection using Kbuild toolchain functions
7+
# Dependency detection using Kconfiglib shell function
88
config HAVE_SDL2
9-
def_bool $(success,pkg-config --exists sdl2)
9+
def_bool $(shell,pkg-config --exists sdl2 && echo y)
1010

1111
config HAVE_PIXMAN
12-
def_bool $(success,pkg-config --exists pixman-1)
12+
def_bool $(shell,pkg-config --exists pixman-1 && echo y)
1313

1414
config HAVE_LIBPNG
15-
def_bool $(success,pkg-config --exists libpng)
15+
def_bool $(shell,pkg-config --exists libpng && echo y)
1616

1717
config HAVE_LIBJPEG
18-
def_bool $(success,pkg-config --exists libjpeg)
18+
def_bool $(shell,pkg-config --exists libjpeg && echo y)
1919

2020
choice
2121
prompt "Backend Selection"

mk/common.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,11 @@ __FORCE:
681681
# Only include dependencies when building known targets
682682
build-goals := all clean $(target-builds)
683683
ifneq ($(MAKECMDGOALS),)
684-
# MAKECMDGOALS is not empty, check if it's a known target
685-
ifneq ($(filter $(MAKECMDGOALS),$(build-goals)),)
686-
# Known target, include dependencies (except for clean)
687-
ifneq "$(MAKECMDGOALS)" "clean"
684+
# MAKECMDGOALS is not empty, check if ALL goals are known
685+
# (i.e., no unknown goals remain after filtering out known ones)
686+
ifeq ($(filter-out $(build-goals),$(MAKECMDGOALS)),)
687+
# All goals are known, include dependencies (except for clean-only builds)
688+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
688689
-include $(target-depends)
689690
endif
690691
endif

0 commit comments

Comments
 (0)