-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (40 loc) · 1 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
EXEC_A:=part_a.out
EXEC_B:=part_b.out
PLOT_A:=part_a.png
PLOT_B:=part_b.png
OBJS:=../utils/poisson.o ../utils/parse_arg.o ../utils/rand_gen.o ../utils/event.o
OBJS_A:=part_a.o $(OBJS)
OBJS_B:=part_b.o $(OBJS)
OBJDIR:=output image
CXX=g++
CXXFLAGS:=-std=c++14
.DEFAULT_GOAL:=all
astyle:
astyle --style=google --indent=spaces=2 *.cc
all: $(OBJDIR) part_a part_b
# running program to generate
./$(EXEC_A) -k 20 -s 10000
./$(EXEC_B) -k 20 -s 10000
plot: plot_a plot_b plot_a_sim plot_b_sim
part_a: $(OBJS_A)
$(CXX) $(CXXFLAGS) $^ -o $(EXEC_A)
part_b: $(OBJS_B)
$(CXX) $(CXXFLAGS) $^ -o $(EXEC_B)
%.o: %.c %.h
$(CXX) $(CXXFLAGS) -c $^
plot_a: part_a
gnuplot scripts/result_a.gp
plot_a_sim: part_a
gnuplot scripts/result_a_sim.gp
plot_b: part_b
gnuplot scripts/result_b.gp
plot_b_sim: part_b
gnuplot scripts/result_b_sim.gp
gnuplot scripts/result_b_sim_x.gp
gnuplot scripts/result_b_sim_y.gp
$(OBJDIR):
mkdir -p $@
clean:
rm $(OBJS_A) $(OBJS_B) $(EXEC_A) $(EXEC_B)
clean_plot:
rm $(PLOT_A) $(PLOT_B)