Separated configuration in makefile
This commit is contained in:
parent
e92e835b3b
commit
1b46dfa245
18
lib/Makefile
18
lib/Makefile
@ -1,11 +1,9 @@
|
||||
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
|
||||
|
||||
include config.mk
|
||||
|
||||
VPATH=../src
|
||||
|
||||
all: $(SHLIBS)
|
||||
@ -14,7 +12,7 @@ libCosmoTool.so: loadRamses.o yorick.o miniargs.o fortran.o interpolate.o load_d
|
||||
|
||||
depend: $(SOURCES)
|
||||
@echo "[DEPENDS] $^"
|
||||
@$(CC) -M -MM $^ > .mydepends
|
||||
@$(CC) $(CPPFLAGS) -M -MM $^ > .mydepends
|
||||
|
||||
install:
|
||||
@mkdir -p ../install/lib
|
||||
@ -32,22 +30,22 @@ clean:
|
||||
@rm -f *.o
|
||||
@rm -f $(PROGS)
|
||||
|
||||
.mydepends: depend
|
||||
.mydepends: depend Makefile config.mk
|
||||
|
||||
%.so:
|
||||
@echo "[LINK SHARED] $@"
|
||||
@$(CXX) -shared -o $@ $^ $(LIBS)
|
||||
@$(CXX) -shared -o $@ $^ $(LDFLAGS) $(LIBS)
|
||||
|
||||
%.prog:
|
||||
@echo "[L] $@"
|
||||
@$(CXX) -o $@ $^ $(LIBS)
|
||||
@$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
@echo "[C] $< ..."
|
||||
@$(CC) -c -fPIC -o $@ $< $(CFLAGS)
|
||||
@$(CC) -c -fPIC -o $@ $< $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
%.o: %.cpp
|
||||
@echo "[C++] $< ..."
|
||||
@$(CXX) -c -fPIC -o $@ $< $(CXXFLAGS)
|
||||
@$(CXX) -c -fPIC -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
||||
|
||||
include .mydepends
|
||||
|
6
lib/config.mk
Normal file
6
lib/config.mk
Normal file
@ -0,0 +1,6 @@
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
CFLAGS=-ggdb -O0
|
||||
CXXFLAGS=-ggdb -O0
|
||||
LDFLAGS=
|
||||
CPPFLAGS=
|
Loading…
Reference in New Issue
Block a user