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