Merge 0.10->trunk
[prosody.git] / util-src / Makefile
index 5f35b81b72f139da6d5d2d985f22e782bdb0a6d0..9c6c377c14a56fd4816729ebf4f45b77a9e5e17f 100644 (file)
@@ -1,12 +1,16 @@
 
 include ../config.unix
 
-CFLAGS+=-ggdb -I$(LUA_INCDIR)
+CFLAGS+=-ggdb -Wall -pedantic -I$(LUA_INCDIR)
 
 INSTALL_DATA=install -m644
 TARGET?=../util/
 
-ALL=encodings.so hashes.so net.so pposix.so signal.so table.so
+ALL=encodings.so hashes.so net.so pposix.so signal.so table.so ringbuffer.so
+
+ifdef RANDOM
+ALL+=crand.so
+endif
 
 .PHONY: all install clean
 .SUFFIXES: .c .o .so
@@ -17,11 +21,14 @@ install: $(ALL)
        $(INSTALL_DATA) $^ $(TARGET)
 
 clean:
-       rm -f $(ALL)
+       rm -f $(ALL) $(patsubst %.so,%.o,$(ALL))
 
 encodings.so: LDLIBS+=$(IDNA_LIBS)
 
 hashes.so: LDLIBS+=$(OPENSSL_LIBS)
 
+crand.o: CFLAGS+=-DWITH_$(RANDOM)
+crand.so: LDLIBS+=$(RANDOM_LIBS)
+
 %.so: %.o
        $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)