| 1 |
# SPDX-License-Identifier: GPL-2.0 |
| 2 |
|
| 3 |
include ../Makefile.deps |
| 4 |
|
| 5 |
CC=gcc |
| 6 |
CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \ |
| 7 |
-I../lib/ -I../generated/ -idirafter $(UAPI_PATH) |
| 8 |
ifeq ("$(DEBUG)","1") |
| 9 |
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan |
| 10 |
endif |
| 11 |
|
| 12 |
LDLIBS=../lib/ynl.a ../generated/protos.a |
| 13 |
|
| 14 |
SRCS=$(wildcard *.c) |
| 15 |
BINS=$(patsubst %.c,%,${SRCS}) |
| 16 |
|
| 17 |
include $(wildcard *.d) |
| 18 |
|
| 19 |
all: $(BINS) |
| 20 |
|
| 21 |
CFLAGS_page-pool=$(CFLAGS_netdev) |
| 22 |
CFLAGS_tc-filter-add:=$(CFLAGS_tc) |
| 23 |
|
| 24 |
$(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS) |
| 25 |
@echo -e '\tCC sample $@' |
| 26 |
@$(COMPILE.c) $(CFLAGS_$@) [email protected] -o [email protected] |
| 27 |
@$(LINK.c) [email protected] -o $@ $(LDLIBS) |
| 28 |
|
| 29 |
clean: |
| 30 |
rm -f *.o *.d *~ |
| 31 |
|
| 32 |
distclean: clean |
| 33 |
rm -f $(BINS) |
| 34 |
|
| 35 |
.PHONY: all clean distclean |
| 36 |
.DEFAULT_GOAL=all |