tMakefile - numeric - C++ library with numerical algorithms
(HTM) git clone git://src.adamsgaard.dk/numeric
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tMakefile (1220B)
---
1 # Define compiler
2 CC=g++
3
4 # Define compiler flags (show all warnings)
5 CPPFLAGS=-Wall -std=c++0x
6 CXXFLAGS=-Wall -std=c++0x
7
8 # Define linker flags
9 LDFLAGS=
10
11 # Define extra libraries to be dynamically linked
12 LDLIBS+=-larmadillo -lstdc++
13
14 # Compile optimized code
15 #CPPFLAGS+=-O2
16
17 # Compile debuggable code
18 #CPPFLAGS+=-g
19
20 # Compile profilable code
21 #CPPFLAGS+=-pg
22 #LDFLAGS+=-pg
23
24 # Define linker
25 LD=g++
26
27 # Filenames of source code
28 SRC=$(shell ls *.cpp)
29
30 # Filenames of object files
31 OBJ=$(SRC:.cpp=.o)
32
33 # Remove file type extension for binary filename
34 BIN=roots
35
36 # The default "all" depends on A and B
37
38 #all: A B
39
40 #A: plot.A.png
41
42 #B: plot.B.png
43
44 #plot.%.png: fit.A.dat fit.B.dat data.A.txt data.B.txt
45 # gnuplot plotall.gp
46
47 #fit.A.dat: $(BIN)
48 # ./$(BIN) data.A.txt fit.A.dat
49
50 #fit.B.dat: $(BIN)
51 # ./$(BIN) data.B.txt fit.B.dat
52 #
53
54 run: $(BIN)
55 ./$(BIN) 2> error.log
56
57 $(BIN): $(OBJ)
58 @# Link object files together
59 $(LD) $(LDFLAGS) $(OBJ) -o $(BIN) $(LDLIBS)
60 @# Execute program and redirect stdout to file
61 @#./$(BIN) > out.txt
62
63 clean:
64 @# Remove object files
65 rm -f $(OBJ)
66 @# Remove binary
67 rm -f $(BIN)
68 @# Remove datafiles and plot
69 #rm -f *.dat *.png
70 @# Remove error log
71 rm -f error.log
72 edit:
73 vim -p Makefile *.cpp *.h
74