1CC=cc
2CFLAGS= -g -I../../include -Wall
3LIBS=  -L../.. -lcrypto
4EXAMPLES=example1 example2 example3 example4
5
6all: $(EXAMPLES) 
7
8example1: example1.o loadkeys.o 
9	$(CC) -o example1 example1.o loadkeys.o $(LIBS)
10
11example2: example2.o loadkeys.o
12	$(CC) -o example2 example2.o loadkeys.o $(LIBS)
13
14example3: example3.o 
15	$(CC) -o example3 example3.o $(LIBS)
16
17example4: example4.o
18	$(CC) -o example4 example4.o $(LIBS)
19
20clean:	
21	rm -f $(EXAMPLES) *.o
22
23test: all
24	@echo
25	@echo Example 1 Demonstrates the sealing and opening APIs
26	@echo Doing the encrypt side...
27	./example1 <README >t.t
28	@echo Doing the decrypt side...
29	./example1 -d <t.t >t.2
30	diff t.2 README
31	rm -f t.t t.2
32	@echo  example1 is OK
33
34	@echo
35	@echo Example2 Demonstrates rsa encryption and decryption
36	@echo   and it should just print \"This the clear text\"
37	./example2
38
39	@echo
40	@echo Example3 Demonstrates the use of symmetric block ciphers
41	@echo in this case it uses EVP_des_ede3_cbc
42	@echo i.e. triple DES in Cipher Block Chaining mode
43	@echo Doing the encrypt side...
44	./example3 ThisIsThePassword <README >t.t
45	@echo Doing the decrypt side...
46	./example3 -d ThisIsThePassword <t.t >t.2
47	diff t.2 README
48	rm -f t.t t.2
49	@echo  example3 is OK
50
51	@echo
52	@echo Example4 Demonstrates base64 encoding and decoding
53	@echo Doing the encrypt side...
54	./example4 <README >t.t
55	@echo Doing the decrypt side...
56	./example4 -d <t.t >t.2
57	diff t.2 README
58	rm -f t.t t.2
59	@echo example4 is OK
60