Commit 4eb99b87 authored by Michael Sherman's avatar Michael Sherman
Browse files

Tweak the examples Makefile to be more robust.

parent c5329db5
...@@ -25,9 +25,10 @@ CFLAGS = -g ...@@ -25,9 +25,10 @@ CFLAGS = -g
FFLAGS = -g FFLAGS = -g
# Extra libraries required when gfortran links with a C++ module. # Extra libraries required when gfortran links with a C++ module.
# Uncomment this on Mac. If this doesn't work, look in /usr/lib to # If this doesn't work, look in /usr/lib to
# see what versions of libstdc++.so you have and try that. # see what versions of libstdc++.so you have and try different
# FCPPLIBS = -lstdc++.6 # versions.
FCPPLIBS = -lstdc++
LIB_DIR=$(OpenMM_INSTALL_DIR)/lib LIB_DIR=$(OpenMM_INSTALL_DIR)/lib
INCLUDE_DIR=$(OpenMM_INSTALL_DIR)/include INCLUDE_DIR=$(OpenMM_INSTALL_DIR)/include
...@@ -48,7 +49,7 @@ all : $(ALL_PROGS) ...@@ -48,7 +49,7 @@ all : $(ALL_PROGS)
# Treat all .cpp source files the same way (except the one that # Treat all .cpp source files the same way (except the one that
# implements the C Wrappers). # implements the C Wrappers).
.cpp : .cpp :
g++ $(CFLAGS) $< -I$(INCLUDE_DIR) -L$(LIB_DIR) $(LIBS) -o $* g++ $(CFLAGS) -I$(INCLUDE_DIR) $< -L$(LIB_DIR) $(LIBS) -o $*
HelloArgonInC: HelloArgonInC.c OpenMM_CWrapper.o HelloArgonInC: HelloArgonInC.c OpenMM_CWrapper.o
g++ $(CFLAGS) -I$(WRAPPER_DIR) HelloArgonInC.c OpenMM_CWrapper.o \ g++ $(CFLAGS) -I$(WRAPPER_DIR) HelloArgonInC.c OpenMM_CWrapper.o \
...@@ -76,5 +77,5 @@ openmm.mod: ...@@ -76,5 +77,5 @@ openmm.mod:
gfortran -c $(FFLAGS) $(WRAPPER_DIR)/OpenMM_Module.f90 gfortran -c $(FFLAGS) $(WRAPPER_DIR)/OpenMM_Module.f90
clean : clean :
rm $(ALL_PROGS) *.o *.mod rm $(ALL_PROGS) *.o *.mod *.obj *.exe
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment