55 lines
1.1 KiB
Makefile
55 lines
1.1 KiB
Makefile
SHLIBS= libCosmoTool.so
|
|
CXX=g++
|
|
CC=gcc
|
|
CXXFLAGS= -ggdb -O0
|
|
CFLAGS= -ggdb -O0
|
|
SOURCES= loadRamses.cpp yorick.cpp miniargs.cpp fortran.cpp interpolate.cpp load_data.cpp
|
|
LIBS= -lnetcdf_c++ -lnetcdf -lgsl -lgslcblas -lm
|
|
|
|
VPATH=../src
|
|
|
|
all: $(SHLIBS)
|
|
|
|
libCosmoTool.so: loadRamses.o yorick.o miniargs.o fortran.o interpolate.o load_data.o
|
|
|
|
depend: $(SOURCES)
|
|
@echo "[DEPENDS] $^"
|
|
@$(CC) -M -MM $^ > .mydepends
|
|
|
|
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
|
|
@cp ../src/*.tcc ../install/include/CosmoTool
|
|
@cp ../src/*.h ../install/include/CosmoTool
|
|
|
|
distclean: clean
|
|
@rm -f .mydepends
|
|
|
|
clean:
|
|
@rm -f *.o
|
|
@rm -f $(PROGS)
|
|
|
|
.mydepends: depend
|
|
|
|
%.so:
|
|
@echo "[LINK SHARED] $@"
|
|
@$(CXX) -shared -o $@ $^ $(LIBS)
|
|
|
|
%.prog:
|
|
@echo "[L] $@"
|
|
@$(CXX) -o $@ $^ $(LIBS)
|
|
|
|
%.o: %.c
|
|
@echo "[C] $< ..."
|
|
@$(CC) -c -fPIC -o $@ $< $(CFLAGS)
|
|
|
|
%.o: %.cpp
|
|
@echo "[C++] $< ..."
|
|
@$(CXX) -c -fPIC -o $@ $< $(CXXFLAGS)
|
|
|
|
include .mydepends
|