summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f58b98f36cb30aa8091b3700431c0a72a9e81e75 (plain) (blame)
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
32
33
34
35
36
DESTDIR=/
SRCFILE=main.c
O=0
CFLAGS += -Wextra -Wall -pedantic -g -O$O -I. -odnsfind -finput-charset=UTF-8 -fextended-identifiers
LIBS += 
CC=cc
VGARGS += --leak-check=full --track-origins=yes --verbose --log-file=valgrind-out.txt --suppressions=/usr/lib/i386-linux-gnu/valgrind/default.supp --show-leak-kinds=all --leak-resolution=high

.NOTPARALLEL:
default:
	$(CC) $(CFLAGS) $(SRCFILE) $(LIBS)

# tests if code compiles under gcc, clang and tcc
cc:
	make -e CC=tcc
	make -e CC=gcc
	make -e CC=clang

install:
	mkdir -p $(DESTDIR)/usr/bin/
	cp dnsfind $(DESTDIR)/usr/bin/

distclean:
	rm dnsfind -f

clean:
	rm dnsfind -f
	
prepare:
	apt install build-essential -y

# developing is to be done on i386. for example the default suppression file is hardcoded for i386 here:
# developing is to be done on bullseye.

valgrind:
	G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind $(VGARGS) ./dnsfind