1 # Makefile for MO-Eval submitter
2 # (c) 2008 Martin Mares <mj@ucw.cz>
4 TLSCF:=$(shell libgnutls-config --cflags)
5 TLSLF:=$(shell libgnutls-config --libs)
6 GCRCF:=$(shell libgcrypt-config --cflags)
11 ### The submit server ###
13 PROGS+=$(addprefix $(SDIR)/,submitd privkey connect)
15 $(SHERLOCK_PERL_MODS): PERL_MODULE_DIR=MO
17 $(SDIR)/submitd: $(addprefix $(SDIR)/,submitd.o commands.o tasks.o) $(LIBUCW) $(LIBSH)
18 $(SDIR)/submitd: CFLAGS+=$(TLSCF) $(GCRCF)
19 $(SDIR)/submitd: LIBS+=$(TLSLF)
21 $(SDIR)/connect: $(SDIR)/connect.o $(LIBUCW)
22 $(SDIR)/connect: CFLAGS+=$(TLSCF) $(GCRCF)
23 $(SDIR)/connect: LIBS+=$(TLSLF)
25 $(SDIR)/privkey: $(SDIR)/privkey.o $(LIBUCW)
26 $(SDIR)/privkey: CFLAGS+=$(TLSCF) $(GCRCF)
27 $(SDIR)/privkey: LIBS+=$(TLSLF)
30 run/cf/submitd: $(SDIR)/submitd.cf
32 ### Submitter perl module ###
34 EXTRA_RUNDIRS+=lib/perl5/MO
35 SUBMIT_PERL_MODS=$(o)/submit/Submit.pm
36 PROGS+=$(SUBMIT_PERL_MODS)
38 ### The submit client and utilities ###
40 PROGS+=$(addprefix $(SDIR)/,contest create-certs remote-status remote-submit show-submits)
42 $(SDIR)/contest: $(s)/submit/contest.pl
43 $(SDIR)/create-certs: $(s)/submit/create-certs.sh
44 $(SDIR)/remote-status: $(s)/submit/remote-status.pl
45 $(SDIR)/remote-submit: $(s)/submit/remote-submit.pl
46 $(SDIR)/show-submits: $(s)/submit/show-submits.pl
49 certtool --generate-privkey --outfile ca-key.pem
50 certtool --generate-privkey --outfile ca-key.pem --template ca-cert.tpl
51 certtool --generate-privkey --outfile server-key.pem
52 certtool --generate-request --load-privkey server-key.pem --outfile server-req.pem --template server-cert.tpl
53 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
54 certtool --generate-privkey --outfile client-key.pem
55 certtool --generate-request --load-privkey client-key.pem --outfile client-req.pem --template client-cert.tpl
56 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
57 # Beware of serial numbers