]> Git Repo - linux.git/blob - tools/net/ynl/generated/Makefile
treewide: remove meaningless assignments in Makefiles
[linux.git] / tools / net / ynl / generated / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2
3 CC=gcc
4 CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
5         -I../lib/ -idirafter $(UAPI_PATH)
6 ifeq ("$(DEBUG)","1")
7   CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
8 endif
9
10 include ../Makefile.deps
11
12 YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
13         --exclude-op stats-get
14
15 TOOL:=../ynl-gen-c.py
16
17 GENS:=ethtool devlink handshake fou netdev nfsd
18 SRCS=$(patsubst %,%-user.c,${GENS})
19 HDRS=$(patsubst %,%-user.h,${GENS})
20 OBJS=$(patsubst %,%-user.o,${GENS})
21
22 all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI)
23
24 protos.a: $(OBJS)
25         @echo -e "\tAR $@"
26         @ar rcs $@ $(OBJS)
27
28 %-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
29         @echo -e "\tGEN $@"
30         @$(TOOL) --mode user --header --spec $< -o $@ $(YNL_GEN_ARG_$*)
31
32 %-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
33         @echo -e "\tGEN $@"
34         @$(TOOL) --mode user --source --spec $< -o $@ $(YNL_GEN_ARG_$*)
35
36 %-user.o: %-user.c %-user.h
37         @echo -e "\tCC $@"
38         @$(COMPILE.c) $(CFLAGS_$*) -o $@ $<
39
40 clean:
41         rm -f *.o
42
43 hardclean: clean
44         rm -f *.c *.h *.a
45
46 regen:
47         @../ynl-regen.sh
48
49 .PHONY: all clean hardclean regen
50 .DEFAULT_GOAL: all
This page took 0.038685 seconds and 4 git commands to generate.