Skip to content

Commit 2e75289

Browse files
authored
Merge pull request #127 from sysprog21/refine-build-system
Refine build system
2 parents 5582b7e + f3c014a commit 2e75289

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Ensure tools/kconfig submodule is initialized
2-
ifeq ($(wildcard tools/kconfig/menuconfig.py),)
3-
$(shell git submodule update --init tools/kconfig)
4-
endif
5-
61
-include .config
72

83
check_goal := $(strip $(MAKECMDGOALS))
@@ -189,7 +184,12 @@ endif
189184

190185
KCONFIGLIB := tools/kconfig/kconfiglib.py
191186
$(KCONFIGLIB):
192-
git submodule update --init tools/kconfig
187+
@if [ -d .git ]; then \
188+
git submodule update --init tools/kconfig; \
189+
else \
190+
echo "Error: Kconfig tools not found"; \
191+
exit 1; \
192+
fi
193193

194194
# Load default configuration
195195
.PHONY: defconfig

mk/common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ _cmd_compile.cxx.host = $(HOSTCXX) $(__HOSTARCHFLAGS) $(__CXXFLAGS) $($1_arc
308308
$$($1_$$<_cxxflags-y) $($1_includes) -c -o $$@ $$<
309309
_cmd_link.cxx.host = $(HOSTCXX) $(__HOSTARCHFLAGS) $(__CXXFLAGS) $($1_libraries) -o $$@ $$(filter-out __FORCE $($1_depends_y),$$^) \
310310
$($1_archflags) $($1_ldflags) $(__LDFLAGS)
311-
_cmd_link_so.cxx.host = $(HOSTCXX) $(__HOSTARCHFLAGS) $(__CXXFLAGS)$($1_libraries) -o $$@ $$(filter-out __FORCE $($1_depends_y),$$^) \
311+
_cmd_link_so.cxx.host = $(HOSTCXX) $(__HOSTARCHFLAGS) $(__CXXFLAGS) $($1_libraries) -o $$@ $$(filter-out __FORCE $($1_depends_y),$$^) \
312312
$($1_archflags) $($1_ldflags) $$(filter-out -static,$(__LDFLAGS)) -shared $$(if $($1_soname-y),-Wl$$(comma)-soname$$(comma)$($1_soname-y),)
313313

314314
_cmd_ar = $(AR) rcs $$@ $$(filter-out __FORCE $($1_depends_y),$$^)

mk/toolchain.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ifndef CXX
2525
CXX := $(CROSS_COMPILE)g++
2626
endif
2727
ifeq ("$(CC_IS_CLANG)", "1")
28-
override CXX := $(dir $(CC))$(subst clang,clang++,$(notdir $(CC)))
28+
override CXX := $(subst clang,clang++,$(CC))
2929
endif
3030

3131
ifndef CPP
@@ -81,5 +81,5 @@ HOSTSTRIP := $(HOST_COMPILE)strip
8181
endif
8282

8383
ifndef HOSTOBJCOPY
84-
HOSTOBJCOPY:= $(HOST_COMPILE)objcpy
84+
HOSTOBJCOPY := $(HOST_COMPILE)objcopy
8585
endif

0 commit comments

Comments
 (0)