Comparison

util-src/Makefile @ 7187:3d2c2f0809ee

util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
author Kim Alvefur <zash@zash.se>
date Mon, 22 Feb 2016 18:44:43 +0100
parent 7117:2b4432cc9c29
child 7612:6ae8dae68ec4
comparison
equal deleted inserted replaced
7186:9c3930bcbb72 7187:3d2c2f0809ee
6 INSTALL_DATA=install -m644 6 INSTALL_DATA=install -m644
7 TARGET?=../util/ 7 TARGET?=../util/
8 8
9 ALL=encodings.so hashes.so net.so pposix.so signal.so table.so ringbuffer.so 9 ALL=encodings.so hashes.so net.so pposix.so signal.so table.so ringbuffer.so
10 10
11 ifdef RANDOM
12 ALL+=crand.so
13 endif
14
11 .PHONY: all install clean 15 .PHONY: all install clean
12 .SUFFIXES: .c .o .so 16 .SUFFIXES: .c .o .so
13 17
14 all: $(ALL) 18 all: $(ALL)
15 19
16 install: $(ALL) 20 install: $(ALL)
17 $(INSTALL_DATA) $^ $(TARGET) 21 $(INSTALL_DATA) $^ $(TARGET)
18 22
19 clean: 23 clean:
20 rm -f $(ALL) 24 rm -f $(ALL) $(patsubst %.so,%.o,$(ALL))
21 25
22 encodings.so: LDLIBS+=$(IDNA_LIBS) 26 encodings.so: LDLIBS+=$(IDNA_LIBS)
23 27
24 hashes.so: LDLIBS+=$(OPENSSL_LIBS) 28 hashes.so: LDLIBS+=$(OPENSSL_LIBS)
25 29
30 crand.o: CFLAGS+=-DWITH_$(RANDOM)
31 crand.so: LDLIBS+=$(RANDOM_LIBS)
32
26 %.so: %.o 33 %.so: %.o
27 $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) 34 $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)