-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
46 lines (35 loc) · 1.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Where VMD is installed on your system
VMDDIR=/usr/local/lib/vmd
# Location of the VMD include files vmdplugin.h and molfile_plugin.h.
# Typically, these files can be found in the subdir
# plugins/include of the VMD installation directory.
VMDCPPFLAGS=-I$(VMDDIR)/plugins/include
#HDF5_CC=clang #for better warnings
CC=HDF5_CC=$(HDF5_CC) h5cc -shlib
#compiler switches http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gnat_ugn_unw/Switches-for-gcc.html
CFLAGS=-Wall -Wuninitialized -std=c99 -pedantic -fPIC
CPPFLAGS=$(VMDCPPFLAGS)
LDFLAGS=-L.
LDLIBS=
SHLD=$(CC)
SHLDFLAGS=-shared -Wl,--no-undefined $(LDFLAGS)
all: h5mdtest libh5md.so h5mdplugin.so
#nasty
h5mdtest: h5mdtest.c h5mdplugin.so libh5md.so
$(CC) h5mdtest.c -o h5mdtest h5mdplugin.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wl,-rpath,'\$$ORIGIN' $(HDF5LIBS) -lh5md
libh5md.so: libh5md.o
$(SHLD) $(CFLAGS) $(SHLDFLAGS) $< -o libh5md.so $(HDF5LIBS) -lm
h5mdplugin.so: h5mdplugin.o libh5md.so
$(SHLD) $(CFLAGS) $(SHLDFLAGS) $< -o h5mdplugin.so $(LDLIBS) -Wl,-rpath,'\$$ORIGIN' -lh5md
check:
cd tests && $(MAKE) check
#remove all files generated by make
clean:
$(RM) h5mdplugin.so
$(RM) h5mdtest
$(RM) libh5md.so
$(RM) *.o
$(RM) *~
$(MAKE) -C tests clean
install: libh5md.so h5mdplugin.so
cp $^ $(VMDDIR)/plugins/LINUXAMD64/molfile/