make makefile a little more general

This commit is contained in:
Guilhem Lavaux 2010-09-12 10:35:25 +02:00
parent 883d1170e2
commit aac070e39f
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
SHLIBS= libCosmoTool.so
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
@ -8,7 +8,7 @@ VPATH=../src
all: $(SHLIBS)
libCosmoTool.so: loadRamses.o yorick.o miniargs.o fortran.o interpolate.o load_data.o powerSpectrum.o octTree.o loadGadget.o
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] $^"
@ -18,7 +18,7 @@ install:
@mkdir -p ../install/lib
@mkdir -p ../install/include/CosmoTool
@echo "Copying libraries"
@cp libCosmoTool.so ../install/lib
@cp libCosmoTool.$(SOSUFFIX) ../install/lib
@echo "Copying header files"
@cp ../src/*.hpp ../install/include/CosmoTool
@cp ../src/*.tcc ../install/include/CosmoTool
@ -32,9 +32,9 @@ clean:
.mydepends: depend Makefile config.mk
%.so:
%.$(SOSUFFIX):
@echo "[LINK SHARED] $@"
@$(CXX) -shared -o $@ $^ $(LDFLAGS) $(LIBS)
@$(CXX) $(SOFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
%.prog:
@echo "[L] $@"

View File

@ -4,3 +4,6 @@ CFLAGS=-ggdb -O0
CXXFLAGS=-ggdb -O0
LDFLAGS=
CPPFLAGS=
SOSUFFIX=so
SOFLAGS=-shared