]> andersk Git - nss_nonlocal.git/blobdiff - Makefile
Use $(CC) for linktest.
[nss_nonlocal.git] / Makefile
index 954563569abb5c433ed2243611bdead358ebd1d7..19c766efa47444f1268e674e882d3d9531c287bc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,15 +4,16 @@ libdir = $(exec_prefix)/lib
 INSTALL = install
 CC = gcc
 CFLAGS = -O2 -Wall
-LD = ld
 
 ALL_CFLAGS = $(CFLAGS) -fPIC
-ALL_LDFLAGS = $(LDFLAGS) -shared -pthread -Wl,-x
+ALL_LDFLAGS = $(LDFLAGS) -shared -Wl,-x
 
 all: libnss_nonlocal.so.2 linktest
 
-libnss_nonlocal.so.2: nonlocal-passwd.o nonlocal-group.o nonlocal-shadow.o
-       $(CC) -o $@ $(ALL_LDFLAGS) -Wl,-soname,$@ $^ $(LOADLIBES) $(LDLIBS)
+OBJS = nonlocal-passwd.o nonlocal-group.o nonlocal-shadow.o
+
+libnss_nonlocal.so.2: $(OBJS) libnss_nonlocal.map
+       $(CC) -o $@ $(ALL_LDFLAGS) -Wl,-soname,$@ -Wl,--version-script=libnss_nonlocal.map $(OBJS) $(LOADLIBES) $(LDLIBS)
 
 %.o: %.c
        $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $<
@@ -22,13 +23,13 @@ nonlocal-group.o: nonlocal-group.c nsswitch-internal.h nonlocal.h
 nonlocal-shadow.o: nonlocal-shadow.c nsswitch-internal.h nonlocal.h
 
 linktest: libnss_nonlocal.so.2
-       $(LD) --entry=0 -o /dev/null $^
+       $(CC) $(LDFLAGS) -nostdlib -Wl,--entry=0 -o /dev/null $^
 
 install: libnss_nonlocal.so.2
        $(INSTALL) -d $(DESTDIR)$(libdir)
        $(INSTALL) -m a+r,u+w $< $(DESTDIR)$(libdir)/
 
 clean:
-       rm -f *.so.* *.o test-nonlocal
+       rm -f *.so.* *.o
 
 .PHONY: all linktest install clean
This page took 0.045319 seconds and 4 git commands to generate.