61aff61e835df26cbe00566afe0995c8db6da414
[aes.git] / Makefile
1 CC=g++
2 CFLAGS=-march=athlon-xp -O2
3
4 all: problem2 problem3
5
6 aes_test: aes.o aes_test.o
7         $(CC) $(CFLAGS) -o $@ $^
8
9 problem2: aes.o problem2.o
10         $(CC) $(CFLAGS) -o $@ $^
11
12 problem3: aes.o problem3.o
13         $(CC) $(CFLAGS) -o $@ $^
14
15 clean:
16         rm -f *.o aes_test problem2 problem3
17         latexmk -C
18         rm -f homework.out p2_output.txt p3_output.txt
19
20 .cpp.o:
21         $(CC) $(CFLAGS) -c -o $@ $<
22
23 run: run_p2 run_p3
24
25 run_p2: problem2
26         @cat Problem2.in | ./$<
27
28 run_p3: problem3
29         @./$<
30
31 pdf: homework.tex problem2 problem3
32         ./problem2 < Problem2.in > p2_output.txt
33         ./problem3 > p3_output.txt
34         @rm -f homework.pdf
35         latexmk -pdf homework.tex
36
37 .PHONY: run all clean pdf