Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fixes #559

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tools/build/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ else
Q=@
endif

ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
# If the user is running make -s (silent mode), suppress echoing of commands
# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
ifeq ($(filter 3.%,$(MAKE_VERSION)),)
short-opts := $(firstword -$(MAKEFLAGS))
else
short-opts := $(filter-out --%,$(MAKEFLAGS))
endif

ifneq ($(findstring s,$(short-opts)),)
quiet=silent_
endif

Expand Down
15 changes: 11 additions & 4 deletions tools/lkl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ export CFLAGS += -I$(OUTPUT)/include -Iinclude -Wall -g -O2 -Wextra \

-include Targets

TARGETS := $(progs-y:%=$(OUTPUT)%$(EXESUF))
TARGETS += $(libs-y:%=$(OUTPUT)%$(SOSUF))
# Expand targets to output location and suffix but preserve special
# targets (e.g. .WAIT)
# $1 - targets
# $2 - suffix
expand-targets = $(foreach t,$(1),$(if $(filter .%,$(t)),$(t),$(OUTPUT)$(t)$(2)))

TARGETS := $(call expand-targets,$(progs-y),$(EXESUF))
TARGETS += $(call expand-targets,$(tests-y),$(EXESUF))
TARGETS += $(call expand-targets,$(libs-y),$(SOSUF))
all: $(TARGETS)

# this workaround is for FreeBSD
Expand Down Expand Up @@ -135,7 +142,7 @@ libraries_install: $(libs-y:%=$(OUTPUT)%$(SOSUF)) $(OUTPUT)liblkl.a
install -d $(DESTDIR)$(LIBDIR) ; \
install -m 644 $^ $(DESTDIR)$(LIBDIR)

programs_install: $(progs-y:%=$(OUTPUT)%$(EXESUF))
programs_install: $(call expand-targets,$(progs-y),$(EXESUF))
$(call QUIET_INSTALL, programs) \
install -d $(DESTDIR)$(BINDIR) ; \
install -m 755 $^ $(DESTDIR)$(BINDIR)
Expand All @@ -157,4 +164,4 @@ FORCE: ;
.PHONY: headers_install libraries_install programs_install install
.NOTPARALLEL : lib/lkl.o
.SECONDARY:

.WAIT:
17 changes: 11 additions & 6 deletions tools/lkl/Targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ progs-$(LKL_HOST_CONFIG_ARCHIVE) += cptofs
LDLIBS_cptofs-y := -larchive
LDLIBS_cptofs-$(LKL_HOST_CONFIG_NEEDS_LARGP) += -largp

progs-y += tests/boot
progs-y += tests/disk
progs-y += tests/disk-vfio-pci
progs-y += tests/net-test
progs-y += tests/config
# tools/build/Makefile.build does not support parallel builds when
# objects are shared between build objects so keep the test that uses
# the most common object first and insert a build barrier to avoid
# rebuilding common objects
tests-y := tests/disk
tests-y += .WAIT
tests-y += tests/boot
tests-y += tests/disk-vfio-pci
tests-y += tests/net-test
tests-y += tests/config
ifneq ($(LKL_HOST_CONFIG_BSD),y)
progs-y += tests/test-dlmopen
tests-y += tests/test-dlmopen
LDLIBS_tests/test-dlmopen-$(LKL_HOST_CONFIG_POSIX) += -ldl
endif

Expand Down
Loading