-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
35 lines (25 loc) · 788 Bytes
/
Makefile
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
DESTDIR ?=
NSSDIR ?= /usr/lib
LIBUNBOUND ?= unbound
LIBDIRS ?=
CC = gcc
CFLAGS = --std=gnu99 -fPIC -O2 -g -ggdb -Wall
LDFLAGS = -l$(LIBUNBOUND) $(LIBDIRS)
STATIC_LDFLAGS = -Wl,-Bstatic -l$(LIBUNBOUND) -lldns -Wl,-Bdynamic -lcrypto -lpthread $(LIBDIRS)
MODULE = libnss_ubdns.so.2
BINS = $(MODULE)
all: $(BINS)
OBJS = arpa.o domain_to_str.o lookup.o nss-ubdns.o
ifdef STATIC_LIBUNBOUND
$(MODULE): $(OBJS)
$(CC) -fPIC -shared -Wl,-h,$(MODULE) -Wl,--version-script,nss_ubdns.map -o $@ $^ $(STATIC_LDFLAGS)
else
$(MODULE): $(OBJS)
$(CC) -fPIC -shared -Wl,-h,$(MODULE) -Wl,--version-script,nss_ubdns.map -o $@ $^ $(LDFLAGS)
endif
clean:
rm -f $(BINS) $(OBJS)
install:
mkdir -p $(DESTDIR)$(NSSDIR)
install -m 0644 $(MODULE) $(DESTDIR)$(NSSDIR)/$(MODULE)
.PHONY: all clean install