GNUMakefile 2.44 KB
Newer Older
1
# Makefile for the hyperviewer application directory.  See ROADMAP for details.
2
# gmake -f GNUMakefile
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

# Tamara Munzner's Stanford HyperViewer code is in a subdirectory under here.
HVROOT = hypviewer
HVINC  = ${HVROOT}/include
HVSRC  = ${HVROOT}/src

# The follosing matches Munzner's Makefile scheme.
CPU = free
##CPU = linux
WINSYS = glut
##WINSYS = xt
ARCH = ${CPU}${WINSYS}

LIBRARY = hypviewer
HVLIBDIR  = ${HVSRC}/${ARCH}
HVLIBNAME = ${LIBRARY}${ARCH}
HVLIB = ${HVLIBDIR}/lib${HVLIBNAME}.a

CFLAGS  = -DHYPGLUT -DHYPFREE -DGL_GLEXT_LEGACY -g -DNAMESPACEHACK=
INCDIRS = -I${HVINC} -I/usr/X11R6/include -I/usr/local/include/python2.3
23 24
###STATIC =  -static
LDLIBS  = ${HVLIB} ${STATIC} -L/usr/X11R6/lib -lGLU -lGL -lXmu -lXext -lX11 -lm
25

26
# Distribute the Python scripts, sources, shared library, sample input files, and user doc.
27
PYFILES = hypview.py exptToHv.py sshxmlrpc.py emulabclient.py hvFrameUI.py hv.py
28 29 30
SRCFILES = README ROADMAP GNUMakefile hvgui.wxg hvmain.cpp hv.i hv.mod _hv.cpp
BINFILES = _hv.so 
DATAFILES = BigLan.hyp ts600.hyp
31
SCRIPTFILES = hypview pangorc.local pango.modules.local
32 33 34
DOCDIR = www
DISTFILES = ${SCRIPTFILES} ${PYFILES} ${SRCFILES} ${BINFILES} ${DATAFILES} ${DOCDIR} ${HVROOT}
DISTARCH = FreeBSD
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

# Finally, make something.
default: _hv.so

# The input for SWIG is in a .i file.  Add stuff to the interface class .h file.
# How come %apply doesn't work for std::string in hv.mod?  Workaround with sed instead.
hv.i: hv.mod ${HVINC}/HypView.h
	sed -e 's/const string & [a-z][a-z]*/const std::string \& INPUT/g' \
	    ${HVINC}/HypView.h | cat hv.mod - > hv.i

# Create the wrappers using SWIG.
hvmain.o: hvmain.cpp
	g++ -fpic -c ${CFLAGS} ${INCDIRS} hvmain.cpp
_hv.cpp hv.py: hv.i
	swig -c++ -python -DHYPGLUT -DHYPFREE -module hv -o _hv.cpp hv.i

# Put the wrappers in a shared library for import by hv.py .
_hv.o: _hv.cpp
	g++ -fpic -c ${CFLAGS} ${INCDIRS} _hv.cpp
_hv.so: hvmain.o _hv.o ${HVLIB}
	gcc -shared hvmain.o _hv.o ${LDLIBS} -o _hv.so

hvlib: ${HVLIB}
${HVLIB}:
	@echo ""
	@echo Make sure that Makefile.${ARCH} is included, and not commented-out.
	grep Makefile.${ARCH} ${HVROOT}/Makefile.main
	@echo ""
	@echo Making ${HVLIB}
	cd ${HVROOT}; make

dist:
	# Wrap a top-level hyperviewer directory around the dist files in the tarball.
	mkdir -p temp/hyperviewer
69
	cp -rp ${DISTFILES} temp/hyperviewer
70 71
	ln -s ${DOCDIR}/index.html temp/hyperviewer
	tar cfz hyperviewer-${DISTARCH}.tgz -C temp hyperviewer
72
	rm -rf temp
73 74 75 76

clean:
	rm *.o *.so
	cd ${HVROOT}; make clean