mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-27 01:11:31 +00:00
Makefile.deps provides direct includes in CFLAGS_$(obj). We just need to rewrite the rules to make use of the extra flags, no need to hard-include all of tools/include/uapi. Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/r/20231003153416.2479808-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
33 lines
670 B
Makefile
33 lines
670 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
include ../Makefile.deps
|
|
|
|
CC=gcc
|
|
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
|
|
-I../lib/ -I../generated/ -idirafter $(UAPI_PATH)
|
|
ifeq ("$(DEBUG)","1")
|
|
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
|
|
endif
|
|
|
|
LDLIBS=-lmnl ../lib/ynl.a ../generated/protos.a
|
|
|
|
SRCS=$(wildcard *.c)
|
|
BINS=$(patsubst %.c,%,${SRCS})
|
|
|
|
include $(wildcard *.d)
|
|
|
|
all: $(BINS)
|
|
|
|
$(BINS): ../lib/ynl.a ../generated/protos.a
|
|
@echo -e '\tCC sample $@'
|
|
@$(COMPILE.c) $(CFLAGS_$@) $@.c -o $@.o
|
|
@$(LINK.c) $@.o -o $@ $(LDLIBS)
|
|
|
|
clean:
|
|
rm -f *.o *.d *~
|
|
|
|
hardclean: clean
|
|
rm -f $(BINS)
|
|
|
|
.PHONY: all clean
|
|
.DEFAULT_GOAL=all
|