2023-06-05 12:01:08 -07:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
2023-06-13 17:28:00 -07:00
|
|
|
include ../Makefile.deps
|
|
|
|
|
2023-06-05 12:01:08 -07:00
|
|
|
CC=gcc
|
2024-11-12 09:21:33 +01:00
|
|
|
CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
|
2023-10-03 08:34:16 -07:00
|
|
|
-I../lib/ -I../generated/ -idirafter $(UAPI_PATH)
|
2023-06-05 12:01:08 -07:00
|
|
|
ifeq ("$(DEBUG)","1")
|
|
|
|
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
|
|
|
|
endif
|
|
|
|
|
2024-02-27 14:30:31 -08:00
|
|
|
LDLIBS=../lib/ynl.a ../generated/protos.a
|
2023-06-05 12:01:08 -07:00
|
|
|
|
|
|
|
SRCS=$(wildcard *.c)
|
|
|
|
BINS=$(patsubst %.c,%,${SRCS})
|
|
|
|
|
|
|
|
include $(wildcard *.d)
|
|
|
|
|
|
|
|
all: $(BINS)
|
|
|
|
|
2023-11-29 11:36:20 -08:00
|
|
|
CFLAGS_page-pool=$(CFLAGS_netdev)
|
|
|
|
|
2023-11-26 15:07:40 -08:00
|
|
|
$(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
|
2023-10-03 08:34:16 -07:00
|
|
|
@echo -e '\tCC sample $@'
|
|
|
|
@$(COMPILE.c) $(CFLAGS_$@) $@.c -o $@.o
|
|
|
|
@$(LINK.c) $@.o -o $@ $(LDLIBS)
|
2023-06-05 12:01:08 -07:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.d *~
|
|
|
|
|
2024-03-04 21:13:26 -08:00
|
|
|
distclean: clean
|
2023-06-05 12:01:08 -07:00
|
|
|
rm -f $(BINS)
|
|
|
|
|
2024-03-04 21:13:27 -08:00
|
|
|
.PHONY: all clean distclean
|
2023-06-05 12:01:08 -07:00
|
|
|
.DEFAULT_GOAL=all
|