]> mj.ucw.cz Git - moe.git/blob - submit/Makefile
Use LDLIBS instead of LDFLAGS to link libraries.
[moe.git] / submit / Makefile
1 UCWCF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --cflags libucw libsh)
2 UCWLF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --libs libucw libsh)
3 TLSCF:=$(shell libgnutls-config --cflags)
4 TLSLF:=$(shell libgnutls-config --libs)
5 GCRCF:=$(shell libgcrypt-config --cflags)
6
7 CFLAGS+=$(UCWCF) $(TLSCF) $(GCRCF)
8 LDLIBS+=$(UCWLF) $(TLSLF)
9
10 all: submitd privkey lib
11
12 submitd: submitd.o commands.o tasks.o
13 submitd.o: submitd.c submitd.h
14 commands.o: commands.c submitd.h
15 tasks.o: tasks.c submitd.h
16 connect: connect.o
17 connect.o: connect.c
18 privkey: privkey.o
19 privkey.o: privkey.c
20
21 certs:
22         certtool --generate-privkey --outfile ca-key.pem
23         certtool --generate-privkey --outfile ca-key.pem --template ca-cert.tpl
24         certtool --generate-privkey --outfile server-key.pem
25         certtool --generate-request --load-privkey server-key.pem --outfile server-req.pem --template server-cert.tpl
26         certtool --generate-certificate --load-request server-req.pem --outfile server-cert.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template server-cert.tpl
27         certtool --generate-privkey --outfile client-key.pem
28         certtool --generate-request --load-privkey client-key.pem --outfile client-req.pem --template client-cert.tpl
29         certtool --generate-certificate --load-request client-req.pem --outfile client-cert.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template client-cert.tpl
30         # Beware of serial numbers
31
32 lib: .lib-stamp lib/perl5/MO/Submit.pm lib/perl5/Sherlock/Object.pm
33
34 .lib-stamp:
35         mkdir -p lib/perl5/{MO,Sherlock}
36         touch .lib-stamp
37
38 lib/perl5/MO/Submit.pm: MO/Submit.pm
39         cp $^ $@
40
41 lib/perl5/Sherlock/Object.pm: $(LIBUCW)/lib/perl5/Sherlock/Object.pm
42         cp $^ $@
43
44 clean:
45         rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend -or -name .#*`
46         rm -f submitd connect privkey
47         rm -rf lib .lib-stamp
48
49 .PHONY: lib