/
Makefile
124 lines (97 loc) · 3.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
CC = gcc
LD = gcc
B64DIR = ./base64
BSTRDIR = ./bstrlib
ONERING = ./oneringtorulethemail
GOLLUM = ./gollum
TESTTMP = ./test/tmp
INCLUDES = -I$(BSTRDIR) -I$(B64DIR) -I./
B64OBJS = base64.o
BSTROBJS = bstrlib.o bstrlibext.o
DEFINES =
LFLAGS = -L/usr/lib/ -L./bstrlib -L./base64 -lm -lssl -lcrypt -lcrypto
CFLAGS = -O3 -Wall -pedantic -ansi -s $(DEFINES) -std=c99 -g -D_GNU_SOURCE
install: install-test
rm -f $(TESTTMP)/creds.txt
sudo rm -f $(TREE)/server/bin/boromailutils $(TREE)/server/bin/faramailutils
sudo rm -f $(TREE)/client/bin/gollumutils
install-test: install-unpriv server client gen-certs install-priv
install-unpriv:
./install-unpriv.sh $(TREE)
install-priv:
sudo ./install-priv.sh $(TREE)
gen-certs:
sudo ./gen-certs.sh $(TREE)
%.o : $(B64DIR)/%.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
%.o : $(BSTRDIR)/%.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
%.o: $(ONERING)/%.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
%.o: $(GOLLUM)/%.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
%.o : %.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
server: pemithor boromail faramail
sudo mv $^ $(TREE)/server/bin
sudo cp $(ONERING)/getcert.sh $(TREE)/server/bin
pemithor: pemithor.o
echo Linking: $@
$(CC) $< -o $@ $(LFLAGS)
boromail: boromail.o utils.o boromailutils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o boromailutils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sudo cp boromail $(TREE)/server/bin
faramail: faramail.o utils.o faramailutils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o faramailutils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
boromailutils: boromailutils.o utils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sudo cp boromailutils $(TREE)/server/bin
faramailutils: faramailutils.o utils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sudo cp faramailutils $(TREE)/server/bin
gollumutils: gollumutils.o utils.o $(BSTROBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) -o $@ $(LFLAGS)
sudo cp gollumutils $(TREE)/client/bin
client: sendmsg recvmsg getcert changepw
sudo mv $^ $(TREE)/client/bin
sudo cp $(GOLLUM)/makecsr.sh $(GOLLUM)/genkey.sh $(TREE)/client/bin
sudo cp imopenssl.cnf $(TREE)/client
getcert: get-cert.o utils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
changepw: change-pw.o utils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sendmsg: send-msg.o utils.o gollumutils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o gollumutils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sudo cp sendmsg $(TREE)/client/bin
recvmsg: recv-msg.o utils.o gollumutils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o gollumutils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
sudo cp recvmsg $(TREE)/client/bin
testutils: testutils.o utils.o $(BSTROBJS) $(B64OBJS)
echo Linking: $@
$(CC) $< utils.o $(BSTROBJS) $(B64OBJS) -o $@ $(LFLAGS)
%.o: $(GOLLUM)/%.c
echo Compiling: $<
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -f pemithor boromail boromailutils faramail faramailutils gollumutils getcert changepw sendmsg recvmsg testutils *.o
.PHONY : all
.PHONY : install
.PHONY : install-unpriv
.PHONY : install-priv
.PHONY : install-test
.PHONY : gen-certs
.PHONY : clean