Blob


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