mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 06:50:37 +00:00

Explicitly specify LDFLAGS as an argument to CC so that this can be overridden by the user. Link: https://lore.kernel.org/all/20250328183858.1417835-3-bmasney@redhat.com/ Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
31 lines
789 B
Makefile
31 lines
789 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Makefile for bootconfig command
|
|
include ../scripts/Makefile.include
|
|
|
|
bindir ?= /usr/bin
|
|
|
|
ifeq ($(srctree),)
|
|
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
|
|
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
|
endif
|
|
|
|
LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h
|
|
override CFLAGS += -Wall -g -I$(CURDIR)/include
|
|
|
|
ALL_TARGETS := bootconfig
|
|
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
|
|
|
|
all: $(ALL_PROGRAMS) test
|
|
|
|
$(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC)
|
|
$(CC) $(filter %.c,$^) $(CFLAGS) $(LDFLAGS) -o $@
|
|
|
|
test: $(ALL_PROGRAMS) test-bootconfig.sh
|
|
./test-bootconfig.sh $(OUTPUT)
|
|
|
|
install: $(ALL_PROGRAMS)
|
|
install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
|
|
|
|
clean:
|
|
$(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)
|