1 # This is a GROMACS template makefile for your own utility programs using pkg-config.
3 # Copy this file to whatever directory you are using for your own software
6 # $ source /path/to/GMXRC
7 # $ make -f Makefile.pkg
9 #change the name of the program here
12 #add extra c++ file(s) to compile here
15 ###############################################################3
16 #below only boring default stuff
17 #only change it if you know what you are doing ;-)
19 #what should be done by default
22 #if GMXLDLIB is defined we add it to PKG_CONFIG_PATH
23 ifeq "$(origin GMXLDLIB)" "undefined"
24 $(error "GMXLDLIB not found, please source GMXRC")
26 export PKG_CONFIG_PATH:=${PKG_CONFIG_PATH}:${GMXLDLIB}/pkgconfig
29 #get CPPFLAGS and LDFLAGS from pkg-config
30 CPPFLAGS=`pkg-config --cflags libgromacs`
31 LDFLAGS=`pkg-config --libs libgromacs`
33 #generate a list of object (.o) files
34 OBJS=$(patsubst %.cpp,%.o,$(NAME).cpp $(EXTRA_SRC))
36 #main program depend on all objects, rest is done by implicit rules
38 $(CXX) $(LDFLAGS) -o $@ $^
44 #all, clean are phony rules, e.g. they are always run