Blob


1 include ../Makefile.local
3 .PHONY: all clean runtime
5 all: gg puny-test testdata iri_test cert.pem testca.pem valid.crt invalid.cert.pem
6 ./puny-test
7 ./runtime
8 ./iri_test
10 gg: gg.o ../iri.o ../utf8.o ${COMPAT}
11 ${CC} gg.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS}
13 puny-test: puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT}
14 ${CC} puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT} \
15 -o puny-test ${LDFLAGS}
17 iri_test: iri_test.o ../iri.o ../utf8.o ${COMPAT}
18 ${CC} iri_test.o ../iri.o ../utf8.o ${COMPAT} -o iri_test
20 fill-file: fill-file.o
21 ${CC} fill-file.o -o fill-file
23 key.pem: cert.pem
25 # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
26 # are quicker to generate. DON'T DO THIS AT HOME.
27 cert.pem:
28 printf ".\n.\n.\n.\n.\nlocalhost\n.\n" | \
29 openssl req -x509 -newkey rsa:2048 \
30 -keyout key.pem \
31 -out cert.pem \
32 -days 365 -nodes
33 @echo
35 testca.pem:
36 openssl genrsa -out testca.key 2048
37 printf ".\n.\n.\n.\n.\ntestca\n.\n" | \
38 openssl req -x509 -new -sha256 \
39 -key testca.key \
40 -days 365 -nodes \
41 -out testca.pem
42 @echo
44 valid.crt: testca.pem
45 openssl genrsa -out valid.key 2048
46 printf ".\n.\n.\n.\n.\nvalid\n.\n\n\n"| \
47 openssl req -new -key valid.key \
48 -out valid.csr
49 @echo
50 openssl x509 -req -in valid.csr \
51 -CA testca.pem \
52 -CAkey testca.key \
53 -CAcreateserial \
54 -out valid.crt \
55 -days 365 \
56 -sha256 -extfile valid.ext
58 invalid.cert.pem: cert.pem
59 cp cert.pem invalid.cert.pem
60 cp key.pem invalid.key.pem
62 clean:
63 rm -f *.o iri_test cert.pem key.pem
64 rm -f testca.* valid.csr valid.key invalid.*pem
65 rm -rf testdata fill-file puny-test gg
67 testdata: fill-file
68 mkdir testdata
69 ./fill-file testdata/bigfile
70 ./sha testdata/bigfile testdata/bigfile.sha
71 printf "# hello world\n" > testdata/index.gmi
72 ./sha testdata/index.gmi testdata/index.gmi.sha
73 cp hello slow err invalid serve-bigfile env testdata/
74 cp max-length-reply testdata
75 mkdir testdata/dir
76 cp hello testdata/dir
77 cp testdata/index.gmi testdata/dir/foo.gmi
79 runtime: testdata
80 ./runtime