GCC=gcc
CL=clang-11
CFLAGS=-Wall
LIBS=-L../libbpf/src -l:libbpf.a -lelf -lz
#LIBS=-lbpf

all: dns-trace.ebpf.o dns-trace

dns-trace.ebpf.o: src/dns-trace.ebpf.c
	$(CL) -g -O2 -target bpf -D __TARGET_ARCH_x86_64 -D __BPF_TRACING__ -L../libbpf/src -l:libbpf.a -c src/dns-trace.ebpf.c -o src/dns-trace.ebpf.o

dns-trace: src/dns-trace.c
	$(GCC) $(CFLAGS) src/dns-trace.c -o dns-trace $(LIBS)

clean:
	rm -rf src/*.o  && rm dns-trace
