URI:
       tMakefile - numeric - C++ library with numerical algorithms
  HTML git clone git://src.adamsgaard.dk/numeric
   DIR Log
   DIR Files
   DIR Refs
   DIR LICENSE
       ---
       tMakefile (1095B)
       ---
            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=leastsq
           34 
           35 # The default "all" depends on A and B
           36 
           37 all: A B
           38 
           39 A: plot.A.png
           40 
           41 B: plot.B.png
           42 
           43 plot.%.png: fit.A.dat fit.B.dat data.A.txt data.B.txt
           44         gnuplot plotall.gp
           45 
           46 fit.A.dat: $(BIN)
           47         ./$(BIN) data.A.txt fit.A.dat
           48 
           49 fit.B.dat: $(BIN)
           50         ./$(BIN) data.B.txt fit.B.dat
           51 
           52 $(BIN):        $(OBJ)
           53         @# Link object files together
           54         $(LD) $(LDFLAGS) $(OBJ) -o $(BIN) $(LDLIBS)
           55         @# Execute program and redirect stdout to file
           56         @#./$(BIN) > out.txt
           57         
           58 clean: 
           59         @# Remove object files
           60         rm -f $(OBJ)
           61         @# Remove binary
           62         rm -f $(BIN)
           63         @# Remove datafiles and plot
           64         rm -f *.dat *.png
           65 edit:
           66         vim -p Makefile *.cpp *.h *.gp
           67