tMakefile - numeric - C++ library with numerical algorithms
(HTM) git clone git://src.adamsgaard.dk/numeric
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tMakefile (1201B)
---
1 # Define compiler
2 CC=g++
3
4 # Define compiler flags (show all warnings)
5 CPPFLAGS=-Wall -std=c++0x
6
7 # Define linker flags
8 LDFLAGS=
9
10 # Define extra libraries to be dynamically linked
11 LDLIBS+=-larmadillo -lstdc++
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 OBJ=downhill_simplex.o main.o
32 OBJB=downhill_simplex.o main.B.o
33
34 # Remove file type extension for binary filename
35 BIN=optim
36 BINB=optimB
37
38 # The default "all" depends on A and B
39
40 all: A B
41
42
43 A: $(BIN)
44 @# Run program and write amoeba positions to file
45 ./$(BIN) 2> amoeba.dat
46
47 B: $(BINB)
48 ./$(BINB) 2> amoebaB.dat
49
50 $(BIN): $(OBJ)
51 @# Link object files together
52 $(LD) $(LDFLAGS) $(OBJ) -o $(BIN) $(LDLIBS)
53
54 $(BINB): $(OBJB)
55 @# Link object files together
56 $(LD) $(LDFLAGS) $(OBJB) -o $(BINB) $(LDLIBS)
57
58 clean:
59 @# Remove object files
60 rm -f $(OBJ) $(OBJB)
61 @# Remove binaries
62 rm -f $(BIN) $(BINB)
63 @# Remove datafiles and plot
64 #rm -f *.dat *.png
65 @# Remove error log
66 rm -f amoeba.dat amoebaB.dat
67 edit:
68 vim -p Makefile *.cpp *.h
69