mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
07c3cc51a0
Support building the C YNL userspace library into one big static file. We can then link selftests against it for easy to use C netlink interface. Signed-off-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20240628003253.1694510-14-almasrymina@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
32 lines
518 B
Makefile
32 lines
518 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
CC=gcc
|
|
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow
|
|
ifeq ("$(DEBUG)","1")
|
|
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
|
|
endif
|
|
|
|
SRCS=$(wildcard *.c)
|
|
OBJS=$(patsubst %.c,%.o,${SRCS})
|
|
|
|
include $(wildcard *.d)
|
|
|
|
all: ynl.a
|
|
|
|
ynl.a: $(OBJS)
|
|
@echo -e "\tAR $@"
|
|
@ar rcs $@ $(OBJS)
|
|
|
|
clean:
|
|
rm -f *.o *.d *~
|
|
rm -rf __pycache__
|
|
|
|
distclean: clean
|
|
rm -f *.a
|
|
|
|
%.o: %.c
|
|
$(COMPILE.c) -MMD -c -o $@ $<
|
|
|
|
.PHONY: all clean distclean
|
|
.DEFAULT_GOAL=all
|