-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
76 lines (64 loc) · 1.93 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Note: This is only a guess at what needs to be done
# to create the libpbc_core.so object from pbc_core.o.
# It's really just a simple function.
#
# I used some combination of
# -I/Applications/VMD\ 1.9.2.app/Contents/Frameworks/Tcl.framework/Headers
# -L/Applications/VMD\ 1.9.2.app/Contents/Frameworks/Tcl.framework/Versions/8.5
# -ltclstub8.5
# -DUSE_TCL_STUBS
# -shared
# -o libpbc_core.so
# pbc_core.c
#
# e.g.
# gcc -m32 -shared -o libpbc_core.so -DUSE_TCL_STUBS -I"$TCLINC" pbc_core.c -L"$TCLLIB" -ltclstub8.5
#
# Also of note on OSX are the system frameworks:
# -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers
# -L/System/Library/Frameworks/Tcl.framework/Versions/8.5
#
AR= ar
ARFLAGS = cr
RANLIB = ranlib
COMPILEDIR = ../compile
INCDIR=-Isrc
SRCDIR=src
#CXXFLAGS = -g $(CXXFLAGS)
CXXFLAGS += -g
VMFILES = pbcbox.tcl pbcgui.tcl pbcjoin.tcl pbcset.tcl pbctools.tcl \
pbcunwrap.tcl pbcwrap.tcl pkgIndex.tcl
VMVERSION = 3.1
ARCHDIR=${COMPILEDIR}/lib_${ARCH}/tcl/pbctools$(VMVERSION)
VPATH = src ${ARCHDIR}
# only build so if we have a Tcl library
ifdef TCLLIB
ifdef TCLINC
ifdef TCLLDFLAGS
TARGETS = ${ARCHDIR} ${ARCHDIR}/libpbc_core.so
endif
endif
endif
bins:
win32bins:
dynlibs: $(TARGETS)
staticlibs:
win32staticlibs:
distrib:
for localname in `find ../compile -name libpbc_core.so -print` ; do \
pluginname=`echo $$localname | sed s/..\\\/compile\\\/lib_// `; \
dir=`dirname $(PLUGINDIR)/$$pluginname`; \
mkdir -p $$dir; \
cp $$localname $(PLUGINDIR)/$$pluginname; \
cp $(VMFILES) $$dir ; \
done
${ARCHDIR}:
mkdir -p ${ARCHDIR}
LIBPBCOBJS=${ARCHDIR}/pbc_core.o
${ARCHDIR}/libpbc_core.so: ${LIBPBCOBJS}
if [ -n "${TCLSHLD}" ]; \
then ${TCLSHLD} $(LOPTO)$@ ${LIBPBCOBJS} ${TCLLIB} ${TCLLDFLAGS} ${LDFLAGS}; \
else ${SHLD} $(LOPTO)$@ ${LIBPBCOBJS} ${TCLLIB} ${TCLLDFLAGS} ${LDFLAGS}; \
fi
${ARCHDIR}/pbc_core.o: pbc_core.c
${CXX} ${CXXFLAGS} ${TCLINC} ${INCDIR} -c ${SRCDIR}/pbc_core.c $(COPTO)${ARCHDIR}/pbc_core.o