]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - nss/Makefile
Add support for group files
[nsscash/nsscash.git] / nss / Makefile
index 0ce909345aec31410edd330806f82cea50d8c325..f103dafc773d4f4e8b075be4f4141995402f1c81 100644 (file)
@@ -13,30 +13,35 @@ all: libnss_cash.so.2
 
 clean:
        rm -f libnss_cash.so.2 \
-           libcash_test.so tests/pw tests/passwd.nsscash
+           libcash_test.so tests/gr tests/pw \
+           tests/group.nsscash tests/passwd.nsscash
 
 libnss_cash.so.2 libcash_test.so: $(wildcard *.c) $(wildcard *.h)
        $(CC) -o $@ -shared -fPIC -Wl,-soname,$@ \
                $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
-               file.c pw.c search.c \
+               file.c gr.c pw.c search.c \
                $(LDLIBS)
 
 
 # Tests
 
-test: tests/pw tests/passwd.nsscash
+test: tests/gr tests/pw tests/group.nsscash tests/passwd.nsscash
+       LD_LIBRARY_PATH=. LD_PRELOD= ./tests/gr
        LD_LIBRARY_PATH=. LD_PRELOD= ./tests/pw
 
-tests/pw: tests/pw.c libcash_test.so
+tests/%: tests/%.c libcash_test.so
        $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
                $(TEST_CFLAGS) $(TEST_LDFLAGS) -L. \
                $< $(LDLIBS) -lcash_test -lasan
 
 tests/passwd.nsscash: tests/passwd
        ../nsscash convert passwd $< $@
+tests/group.nsscash: tests/group
+       ../nsscash convert group $< $@
 
 libcash_test.so: CFLAGS += $(TEST_CFLAGS)
-libcash_test.so: CPPFLAGS += -DNSSCASH_PASSWD_FILE='"./tests/passwd.nsscash"'
+libcash_test.so: CPPFLAGS += -DNSSCASH_GROUP_FILE='"./tests/group.nsscash"' \
+                             -DNSSCASH_PASSWD_FILE='"./tests/passwd.nsscash"'
 libcash_test.so: LDFLAGS += $(TEST_LDFLAGS)
 
 .PHONY: all clean test