mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
1d8617b2a6
Donald points out most YNL makefiles are missing distclean in .PHONY, even tho generated/Makefile does list it. Suggested-by: Donald Hunter <donald.hunter@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
36 lines
717 B
Makefile
36 lines
717 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=../lib/ynl.a ../generated/protos.a
|
|
|
|
SRCS=$(wildcard *.c)
|
|
BINS=$(patsubst %.c,%,${SRCS})
|
|
|
|
include $(wildcard *.d)
|
|
|
|
all: $(BINS)
|
|
|
|
CFLAGS_page-pool=$(CFLAGS_netdev)
|
|
|
|
$(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
|
|
@echo -e '\tCC sample $@'
|
|
@$(COMPILE.c) $(CFLAGS_$@) $@.c -o $@.o
|
|
@$(LINK.c) $@.o -o $@ $(LDLIBS)
|
|
|
|
clean:
|
|
rm -f *.o *.d *~
|
|
|
|
distclean: clean
|
|
rm -f $(BINS)
|
|
|
|
.PHONY: all clean distclean
|
|
.DEFAULT_GOAL=all
|