-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile
More file actions
59 lines (42 loc) · 1.96 KB
/
Copy pathmakefile
File metadata and controls
59 lines (42 loc) · 1.96 KB
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
CC=g++
CFLAGS=-std=c++11 -Wall -g -Iinclude/
SD=src/
ID=include/
BD=build/
ATTACKS=example.o histogram.o caesar_attack.o ngram.o kasiski.o hillatt.o
CIPHERS=caesar.o vigenere.o hill.o rail.o
VER=0.1
TARG=cryptoproject
.PHONY: all clean bd
all: $(TARG)
main.o: bd $(SD)main.cpp $(ID)main.h
$(CC) $(CFLAGS) -DVERSION=$(VER) -c $(SD)main.cpp -o $(BD)main.o
module.o: bd $(SD)module.cpp $(ID)module.h
$(CC) $(CFLAGS) -c $(SD)module.cpp -o $(BD)module.o
example.o: bd $(SD)attacks/example.cpp $(ID)attacks/example.h
$(CC) $(CFLAGS) -c $(SD)attacks/example.cpp -o $(BD)example.o
histogram.o: bd $(SD)attacks/histogram.cpp $(ID)attacks/histogram.h
$(CC) $(CFLAGS) -c $(SD)attacks/histogram.cpp -o $(BD)histogram.o
caesar.o: bd $(SD)ciphers/caesar.cpp $(ID)ciphers/caesar.h
$(CC) $(CFLAGS) -c $(SD)ciphers/caesar.cpp -o $(BD)caesar.o
vigenere.o: bd $(SD)ciphers/vigenere.cpp $(ID)ciphers/vigenere.h
$(CC) $(CFLAGS) -c $(SD)ciphers/vigenere.cpp -o $(BD)vigenere.o
caesar_attack.o: bd $(SD)attacks/caesar_attack.cpp $(ID)attacks/caesar_attack.h
$(CC) $(CFLAGS) -c $(SD)attacks/caesar_attack.cpp -o $(BD)caesar_attack.o
ngram.o: bd $(SD)attacks/ngram.cpp $(ID)attacks/ngram.h
$(CC) $(CFLAGS) -c $(SD)attacks/ngram.cpp -o $(BD)ngram.o
kasiski.o: bd $(SD)attacks/kasiski.cpp $(ID)attacks/kasiski.h
$(CC) $(CFLAGS) -c $(SD)attacks/kasiski.cpp -o $(BD)kasiski.o
hill.o: bd $(SD)ciphers/hill.cpp $(ID)ciphers/hill.h
$(CC) $(CFLAGS) -c $(SD)ciphers/hill.cpp -o $(BD)hill.o
hillatt.o: bd $(SD)attacks/hillatt.cpp $(ID)attacks/hillatt.h
$(CC) $(CFLAGS) -c $(SD)attacks/hillatt.cpp -o $(BD)hillatt.o
rail.o: bd $(SD)ciphers/rail.cpp $(ID)ciphers/rail.h
$(CC) $(CFLAGS) -c $(SD)ciphers/rail.cpp -o $(BD)rail.o
$(TARG): main.o module.o $(ATTACKS) $(CIPHERS) $(TOOLS)
$(CC) $(CFLAGS) $(BD)main.o $(BD)module.o $(addprefix $(BD), $(ATTACKS)) $(addprefix $(BD), $(CIPHERS)) -o $(TARG)
bd:
@if [ ! -d $(BD) ]; then mkdir $(BD); fi
clean:
if [ -x $(TARG) ]; then rm $(TARG); fi
rm -rf $(BD)*.o