forked from danni/docker-nss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 823 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
36
37
38
39
40
41
42
43
44
45
46
47
DESTDIR ?=
NSSDIR ?= /usr/lib
BINDIR ?= /usr/bin
STRIP = strip
CC = gcc
CFLAGS = -fPIC -Wall -Werror -ggdb `pkg-config --cflags glib-2.0`
LDFLAGS = `pkg-config --libs glib-2.0`
OBJS = \
nss.o
MODULE = libnss_docker.so.2
BINS = \
$(MODULE) \
test dockerip
$(MODULE): $(OBJS) Makefile
$(CC) -fPIC -shared -o $@ -Wl,-soname,$@ $< $(LDFLAGS)
TEST_OBJS = \
test.o
INSPECT_OBJS = \
dockerip.o
test: $(TEST_OBJS) $(MODULE) Makefile
$(CC) -o $@ $< $(LDFLAGS)
dockerip: $(INSPECT_OBJS) $(MODULE) Makefile
$(CC) -o $@ $<
$(STRIP) $@
all: $(BINS)
install: all
mkdir -p $(DESTDIR)$(NSSDIR) $(DESTDIR)$(BINDIR)
install -m 0644 $(MODULE) $(DESTDIR)$(NSSDIR)/$(MODULE)
install -g docker -m 2755 dockerip $(DESTDIR)$(BINDIR)/dockerip
ldconfig
clean:
rm -f $(BINS) $(OBJS) $(TEST_OBJS)
.PHONY: all install clean