From aac070e39f0aa2323c74c48c9afecb6785ac99d2 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 12 Sep 2010 10:35:25 +0200 Subject: [PATCH] make makefile a little more general --- lib/Makefile | 10 +++++----- lib/config.mk | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index baa976a..a7fdc5e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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] $@" diff --git a/lib/config.mk b/lib/config.mk index b7d6f8b..dbc2dfb 100644 --- a/lib/config.mk +++ b/lib/config.mk @@ -4,3 +4,6 @@ CFLAGS=-ggdb -O0 CXXFLAGS=-ggdb -O0 LDFLAGS= CPPFLAGS= + +SOSUFFIX=so +SOFLAGS=-shared