summaryrefslogtreecommitdiff
path: root/tools/net/ynl/lib/Makefile
blob: 2887cc5de530fca98f945b7278f9b25f21d03eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 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