]> andersk Git - nss_nonlocal.git/blob - Makefile
10d13068f96e28d8c707dca811e341b49c942e46
[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 -Wl,-x
11
12 all: libnss_nonlocal.so.2 linktest
13
14 OBJS = nonlocal-passwd.o nonlocal-group.o nonlocal-shadow.o
15
16 libnss_nonlocal.so.2: $(OBJS) libnss_nonlocal.map
17         $(CC) -o $@ $(ALL_LDFLAGS) -Wl,-soname,$@ -Wl,--version-script=libnss_nonlocal.map $(OBJS) $(LOADLIBES) $(LDLIBS)
18
19 %.o: %.c
20         $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $<
21
22 nonlocal-passwd.o: nonlocal-passwd.c nsswitch-internal.h nonlocal.h
23 nonlocal-group.o: nonlocal-group.c nsswitch-internal.h nonlocal.h
24 nonlocal-shadow.o: nonlocal-shadow.c nsswitch-internal.h nonlocal.h
25
26 linktest: libnss_nonlocal.so.2
27         $(LD) --entry=0 -o /dev/null $^
28
29 install: libnss_nonlocal.so.2
30         $(INSTALL) -d $(DESTDIR)$(libdir)
31         $(INSTALL) -m a+r,u+w $< $(DESTDIR)$(libdir)/
32
33 clean:
34         rm -f *.so.* *.o
35
36 .PHONY: all linktest install clean
This page took 0.037337 seconds and 3 git commands to generate.