]> andersk Git - nss_nonlocal.git/blob - Makefile
Link with pthread to be safe.
[nss_nonlocal.git] / Makefile
1 exec_prefix = /
2 libdir = $(exec_prefix)/lib
3
4 INSTALL = install
5 CC = gcc
6 CFLAGS = -O2 -Wall
7 LD = ld
8
9 ALL_CFLAGS = $(CFLAGS) -fPIC
10 ALL_LDFLAGS = $(LDFLAGS) -shared -pthread -Wl,-x
11
12 all: libnss_nonlocal.so.2 linktest
13
14 libnss_nonlocal.so.2: nonlocal-passwd.o nonlocal-group.o nonlocal-shadow.o
15         $(CC) -o $@ $(ALL_LDFLAGS) -Wl,-soname,$@ $^ $(LOADLIBES) $(LDLIBS)
16
17 %.o: %.c
18         $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $<
19
20 nonlocal-passwd.o: nonlocal-passwd.c nsswitch-internal.h nonlocal.h
21 nonlocal-group.o: nonlocal-group.c nsswitch-internal.h nonlocal.h
22 nonlocal-shadow.o: nonlocal-shadow.c nsswitch-internal.h nonlocal.h
23
24 linktest: libnss_nonlocal.so.2
25         $(LD) --entry=0 -o /dev/null $^
26
27 install: libnss_nonlocal.so.2
28         $(INSTALL) -d $(DESTDIR)$(libdir)
29         $(INSTALL) -m a+r,u+w $< $(DESTDIR)$(libdir)/
30
31 clean:
32         rm -f *.so.* *.o test-nonlocal
33
34 .PHONY: all linktest install clean
This page took 0.059183 seconds and 5 git commands to generate.