blob: b4b9f3e115024eca4ff62be9edc7069f36c1f9fe [file] [log] [blame]
Guido van Rossum5c8b9911997-07-19 21:00:47 +00001# Makefile for 'pysvr' application embedding Python.
2# Tailored for Python 1.5a3 or later.
Guido van Rossuma88446a1997-07-19 21:34:11 +00003# Some details are specific for Solaris or CNRI.
Guido van Rossum20abb4e1997-08-14 19:48:42 +00004# Also see ## comments for tailoring.
Guido van Rossum5c8b9911997-07-19 21:00:47 +00005
Guido van Rossuma88446a1997-07-19 21:34:11 +00006# Which C compiler
Guido van Rossum5c8b9911997-07-19 21:00:47 +00007CC=gcc
Guido van Rossum20abb4e1997-08-14 19:48:42 +00008##PURIFY=/usr/local/pure/purify
9LINKCC=$(PURIFY) $(CC)
Guido van Rossum5c8b9911997-07-19 21:00:47 +000010
11# Optimization preferences
12OPT=-g
13
Guido van Rossumeb2d36c2001-09-05 19:51:08 +000014# Which Python version we're using
15VER=2.2
Guido van Rossum5c8b9911997-07-19 21:00:47 +000016
Guido van Rossumeb2d36c2001-09-05 19:51:08 +000017# Expressions using the above definitions
Guido van Rossum5c8b9911997-07-19 21:00:47 +000018PYVER=python$(VER)
Guido van Rossumeb2d36c2001-09-05 19:51:08 +000019
Guido van Rossum20abb4e1997-08-14 19:48:42 +000020# Use these defs when compiling against installed Python
Guido van Rossumeb2d36c2001-09-05 19:51:08 +000021##INST=/usr/local
22##PYC=$(INST)/lib/$(PYVER)/config
23##PYINCL=-I$(INST)/include/$(PYVER) -I$(PYC)
24##PYLIBS=$(PYC)/lib$(PYVER).a
25
Guido van Rossum20abb4e1997-08-14 19:48:42 +000026# Use these defs when compiling against built Python
Guido van Rossumeb2d36c2001-09-05 19:51:08 +000027PLAT=linux
28PYINCL=-I../../Include -I../../$(PLAT)
29PYLIBS=../../$(PLAT)/lib$(PYVER).a
Guido van Rossum5c8b9911997-07-19 21:00:47 +000030
Guido van Rossum5c8b9911997-07-19 21:00:47 +000031# Libraries to link with -- very installation dependent
Guido van Rossuma88446a1997-07-19 21:34:11 +000032# (See LIBS= in Modules/Makefile in build tree)
33RLLIBS=-lreadline -ltermcap
Guido van Rossum063ee7b2000-11-03 12:58:09 +000034OTHERLIBS=-lnsl -lpthread -ldl -lm -ldb -lutil
Guido van Rossum5c8b9911997-07-19 21:00:47 +000035
36# Compilation and link flags -- no need to change normally
Neil Schemenauer89e90d62001-06-02 06:16:02 +000037CFLAGS=$(OPT)
38CPPFLAGS=$(PYINCL)
Guido van Rossum5c8b9911997-07-19 21:00:47 +000039LIBS=$(PYLIBS) $(RLLIBS) $(OTHERLIBS)
40
41# Default port for the pysvr application
42PORT=4000
43
44# Default target
45all: pysvr
46
47# Target to build pysvr
Guido van Rossum20abb4e1997-08-14 19:48:42 +000048pysvr: pysvr.o $(PYOBJS) $(PYLIBS)
49 $(LINKCC) pysvr.o $(LIBS) -o pysvr
Guido van Rossum5c8b9911997-07-19 21:00:47 +000050
51# Target to build and run pysvr
52run: pysvr
53 pysvr $(PORT)
54
55# Target to clean up the directory
56clean:
57 -rm -f pysvr *.o *~ core