This repository has been archived on 2024-01-23. You can view files and clone it, but cannot push or open issues or pull requests.
2015-06-05 15:58:00 +02:00
|
|
|
PREFIX ?= /usr
|
|
|
|
DESTDIR ?=
|
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
|
|
|
MANDIR ?= $(PREFIX)/share/man
|
|
|
|
|
2016-07-06 23:51:00 +02:00
|
|
|
CFLAGS += $(shell pkg-config --cflags libmnl 2>/dev/null)
|
2015-06-05 15:58:00 +02:00
|
|
|
CFLAGS += -std=gnu11
|
|
|
|
CFLAGS += -pedantic -Wall -Wextra
|
|
|
|
CFLAGS += -MMD
|
2016-07-06 23:51:00 +02:00
|
|
|
LDLIBS += -lresolv $(shell pkg-config --libs libmnl 2>/dev/null || echo -lmnl)
|
2015-06-05 15:58:00 +02:00
|
|
|
|
|
|
|
wg: $(patsubst %.c,%.o,$(wildcard *.c))
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f wg *.o *.d
|
|
|
|
|
|
|
|
install: wg
|
|
|
|
install -v -d "$(DESTDIR)$(BINDIR)" && install -s -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg"
|
|
|
|
install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
|
|
|
|
|
|
|
|
check: clean
|
|
|
|
CFLAGS=-g scan-build --view --keep-going $(MAKE) wg
|
|
|
|
|
|
|
|
.PHONY: clean install check
|
|
|
|
|
|
|
|
-include *.d
|