2008-12-02 18:22:30 +01:00
|
|
|
SHLIBS= libCosmoTool.so
|
2009-02-04 02:01:58 +01:00
|
|
|
SOURCES= loadRamses.cpp yorick.cpp miniargs.cpp fortran.cpp interpolate.cpp load_data.cpp powerSpectrum.cpp
|
2009-01-08 16:19:13 +01:00
|
|
|
LIBS= -lnetcdf_c++ -lnetcdf -lgsl -lgslcblas -lm
|
2008-12-02 18:22:30 +01:00
|
|
|
|
2009-01-11 17:04:59 +01:00
|
|
|
include config.mk
|
|
|
|
|
2008-12-02 18:22:46 +01:00
|
|
|
VPATH=../src
|
|
|
|
|
2008-12-02 18:22:30 +01:00
|
|
|
all: $(SHLIBS)
|
|
|
|
|
2009-02-04 02:01:58 +01:00
|
|
|
libCosmoTool.so: loadRamses.o yorick.o miniargs.o fortran.o interpolate.o load_data.o powerSpectrum.o
|
2008-12-02 18:22:46 +01:00
|
|
|
|
2008-12-02 18:22:30 +01:00
|
|
|
depend: $(SOURCES)
|
|
|
|
@echo "[DEPENDS] $^"
|
2009-01-11 17:04:59 +01:00
|
|
|
@$(CC) $(CPPFLAGS) -M -MM $^ > .mydepends
|
2008-12-02 18:22:30 +01:00
|
|
|
|
2008-12-02 18:22:46 +01:00
|
|
|
install:
|
|
|
|
@mkdir -p ../install/lib
|
|
|
|
@mkdir -p ../install/include/CosmoTool
|
|
|
|
@echo "Copying libraries"
|
|
|
|
@cp libCosmoTool.so ../install/lib
|
|
|
|
@echo "Copying header files"
|
|
|
|
@cp ../src/*.hpp ../install/include/CosmoTool
|
2009-01-08 16:19:13 +01:00
|
|
|
@cp ../src/*.tcc ../install/include/CosmoTool
|
2008-12-02 18:22:46 +01:00
|
|
|
|
2008-12-02 18:22:30 +01:00
|
|
|
distclean: clean
|
|
|
|
@rm -f .mydepends
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -f *.o
|
|
|
|
@rm -f $(PROGS)
|
|
|
|
|
2009-01-11 17:04:59 +01:00
|
|
|
.mydepends: depend Makefile config.mk
|
2008-12-02 18:22:30 +01:00
|
|
|
|
|
|
|
%.so:
|
|
|
|
@echo "[LINK SHARED] $@"
|
2009-01-11 17:04:59 +01:00
|
|
|
@$(CXX) -shared -o $@ $^ $(LDFLAGS) $(LIBS)
|
2008-12-02 18:22:30 +01:00
|
|
|
|
|
|
|
%.prog:
|
|
|
|
@echo "[L] $@"
|
2009-01-11 17:04:59 +01:00
|
|
|
@$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
|
2008-12-02 18:22:30 +01:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
@echo "[C] $< ..."
|
2009-01-11 17:04:59 +01:00
|
|
|
@$(CC) -c -fPIC -o $@ $< $(CPPFLAGS) $(CFLAGS)
|
2008-12-02 18:22:30 +01:00
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
@echo "[C++] $< ..."
|
2009-01-11 17:04:59 +01:00
|
|
|
@$(CXX) -c -fPIC -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
2008-12-02 18:22:30 +01:00
|
|
|
|
|
|
|
include .mydepends
|