41 lines
594 B
Makefile
41 lines
594 B
Makefile
SHLIBS= libCosmoTool.so
|
|
CXX=g++
|
|
CC=gcc
|
|
CXXFLAGS= -ggdb -O3
|
|
CFLAGS= -ggdb -O3
|
|
SOURCES= loadRamses.cpp yorick.cpp
|
|
LIBS= -lnetcdf_c++ -lnetcdf -lm
|
|
|
|
all: $(SHLIBS)
|
|
|
|
depend: $(SOURCES)
|
|
@echo "[DEPENDS] $^"
|
|
@$(CC) -M -MM $^ > .mydepends
|
|
|
|
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 -o $@ $< $(CFLAGS)
|
|
|
|
%.o: %.cpp
|
|
@echo "[C++] $< ..."
|
|
@$(CXX) -c -o $@ $< $(CXXFLAGS)
|
|
|
|
include .mydepends
|