-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "fixed" part of the user space Netlink Spec-based library. This will get linked with the protocol implementations to form a full API. Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Jakub Kicinski
committed
Jun 6, 2023
1 parent
a99bfdf
commit 86878f1
Showing
7 changed files
with
1,310 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
SUBDIRS = lib generated samples | ||
|
||
all: $(SUBDIRS) | ||
|
||
$(SUBDIRS): | ||
@if [ -f "$@/Makefile" ] ; then \ | ||
$(MAKE) -C $@ ; \ | ||
fi | ||
|
||
clean hardclean: | ||
@for dir in $(SUBDIRS) ; do \ | ||
if [ -f "$$dir/Makefile" ] ; then \ | ||
$(MAKE) -C $$dir $@; \ | ||
fi \ | ||
done | ||
|
||
.PHONY: clean all $(SUBDIRS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
CC=gcc | ||
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ | ||
-I../lib/ | ||
ifeq ("$(DEBUG)","1") | ||
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan | ||
endif | ||
|
||
TOOL:=../ynl-gen-c.py | ||
|
||
GENS:= | ||
SRCS=$(patsubst %,%-user.c,${GENS}) | ||
HDRS=$(patsubst %,%-user.h,${GENS}) | ||
OBJS=$(patsubst %,%-user.o,${GENS}) | ||
|
||
all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI) regen | ||
|
||
protos.a: $(OBJS) | ||
@echo -e "\tAR $@" | ||
@ar rcs $@ $(OBJS) | ||
|
||
%-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL) | ||
@echo -e "\tGEN $@" | ||
@$(TOOL) --mode user --header --spec $< > $@ | ||
|
||
%-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL) | ||
@echo -e "\tGEN $@" | ||
@$(TOOL) --mode user --source --spec $< > $@ | ||
|
||
%-user.o: %-user.c %-user.h | ||
@echo -e "\tCC $@" | ||
@$(COMPILE.c) -c -o $@ $< | ||
|
||
clean: | ||
rm -f *.o | ||
|
||
hardclean: clean | ||
rm -f *.c *.h *.a | ||
|
||
regen: | ||
@../ynl-regen.sh | ||
|
||
.PHONY: all clean hardclean regen | ||
.DEFAULT_GOAL: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 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) | ||
ar rcs $@ $(OBJS) | ||
clean: | ||
rm -f *.o *.d *~ | ||
|
||
hardclean: clean | ||
rm -f *.a | ||
|
||
%.o: %.c | ||
$(COMPILE.c) -MMD -c -o $@ $< | ||
|
||
.PHONY: all clean | ||
.DEFAULT_GOAL=all |
Oops, something went wrong.