cosmotool/lib/Makefile
2010-09-12 10:35:25 +02:00

52 lines
1.2 KiB
Makefile

SHLIBS= libCosmoTool.$(SOSUFFIX)
SOURCES= loadRamses.cpp yorick.cpp miniargs.cpp fortran.cpp interpolate.cpp load_data.cpp powerSpectrum.cpp octTree.cpp loadGadget.cpp
LIBS= -lnetcdf_c++ -lnetcdf -lgsl -lgslcblas -lm
include config.mk
VPATH=../src
all: $(SHLIBS)
libCosmoTool.$(SOSUFFIX): loadRamses.o yorick.o miniargs.o fortran.o interpolate.o load_data.o powerSpectrum.o octTree.o loadGadget.o
depend: $(SOURCES)
@echo "[DEPENDS] $^"
@$(CC) $(CPPFLAGS) -M -MM $^ > .mydepends
install:
@mkdir -p ../install/lib
@mkdir -p ../install/include/CosmoTool
@echo "Copying libraries"
@cp libCosmoTool.$(SOSUFFIX) ../install/lib
@echo "Copying header files"
@cp ../src/*.hpp ../install/include/CosmoTool
@cp ../src/*.tcc ../install/include/CosmoTool
distclean: clean
@rm -f .mydepends
clean:
@rm -f *.o
@rm -f $(PROGS)
.mydepends: depend Makefile config.mk
%.$(SOSUFFIX):
@echo "[LINK SHARED] $@"
@$(CXX) $(SOFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
%.prog:
@echo "[L] $@"
@$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
%.o: %.c
@echo "[C] $< ..."
@$(CC) -c -fPIC -o $@ $< $(CPPFLAGS) $(CFLAGS)
%.o: %.cpp
@echo "[C++] $< ..."
@$(CXX) -c -fPIC -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
include .mydepends