Add initial support for python bindings
[alexxy/gromacs.git] / share / template / Makefile.pkg
1 # This is a Gromacs template makefile for your own utility programs using pkg-config.
2 #
3 # Copy this file to whatever directory you are using for your own software
4 #
5 # Usage:
6 # $ source /path/to/GMXRC
7 # $ make -f Makefile.pkg
8 #
9 #change the name of the program here
10 NAME=template
11
12 #add extra c++ file(s) to compile here
13 EXTRA_SRC=
14
15 ###############################################################3
16 #below only boring default stuff
17 #only change it if you know what you are doing ;-)
18
19 #what should be done by default
20 all: $(NAME)
21
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")
25 else
26   export PKG_CONFIG_PATH:=${PKG_CONFIG_PATH}:${GMXLDLIB}/pkgconfig
27 endif
28
29 #get CPPFLAGS and LDFLAGS from pkg-config
30 CPPFLAGS=`pkg-config --cflags libgromacs`
31 LDFLAGS=`pkg-config --libs libgromacs`
32
33 #generate a list of object (.o) files
34 OBJS=$(patsubst %.cpp,%.o,$(NAME).cpp $(EXTRA_SRC))
35
36 #main program depend on all objects, rest is done by implicit rules
37 $(NAME): $(OBJS)
38         $(CXX) $(LDFLAGS) -o $@ $^
39
40 #clean up rule
41 clean:
42         rm -f $(NAME) $(OBJS)
43
44 #all, clean are phony rules, e.g. they are always run
45 .PHONY: all clean