Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 1 | # Makefile for 'pysvr' application embedding Python. |
| 2 | # Tailored for Python 1.5a3 or later. |
Guido van Rossum | a88446a | 1997-07-19 21:34:11 +0000 | [diff] [blame] | 3 | # Some details are specific for Solaris or CNRI. |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 4 | # Also see ## comments for tailoring. |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 5 | |
Guido van Rossum | a88446a | 1997-07-19 21:34:11 +0000 | [diff] [blame] | 6 | # Which C compiler |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 7 | CC=gcc |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 8 | ##PURIFY=/usr/local/pure/purify |
| 9 | LINKCC=$(PURIFY) $(CC) |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 10 | |
| 11 | # Optimization preferences |
| 12 | OPT=-g |
| 13 | |
Guido van Rossum | eb2d36c | 2001-09-05 19:51:08 +0000 | [diff] [blame^] | 14 | # Which Python version we're using |
| 15 | VER=2.2 |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 16 | |
Guido van Rossum | eb2d36c | 2001-09-05 19:51:08 +0000 | [diff] [blame^] | 17 | # Expressions using the above definitions |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 18 | PYVER=python$(VER) |
Guido van Rossum | eb2d36c | 2001-09-05 19:51:08 +0000 | [diff] [blame^] | 19 | |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 20 | # Use these defs when compiling against installed Python |
Guido van Rossum | eb2d36c | 2001-09-05 19:51:08 +0000 | [diff] [blame^] | 21 | ##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 Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 26 | # Use these defs when compiling against built Python |
Guido van Rossum | eb2d36c | 2001-09-05 19:51:08 +0000 | [diff] [blame^] | 27 | PLAT=linux |
| 28 | PYINCL=-I../../Include -I../../$(PLAT) |
| 29 | PYLIBS=../../$(PLAT)/lib$(PYVER).a |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 30 | |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 31 | # Libraries to link with -- very installation dependent |
Guido van Rossum | a88446a | 1997-07-19 21:34:11 +0000 | [diff] [blame] | 32 | # (See LIBS= in Modules/Makefile in build tree) |
| 33 | RLLIBS=-lreadline -ltermcap |
Guido van Rossum | 063ee7b | 2000-11-03 12:58:09 +0000 | [diff] [blame] | 34 | OTHERLIBS=-lnsl -lpthread -ldl -lm -ldb -lutil |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 35 | |
| 36 | # Compilation and link flags -- no need to change normally |
Neil Schemenauer | 89e90d6 | 2001-06-02 06:16:02 +0000 | [diff] [blame] | 37 | CFLAGS=$(OPT) |
| 38 | CPPFLAGS=$(PYINCL) |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 39 | LIBS=$(PYLIBS) $(RLLIBS) $(OTHERLIBS) |
| 40 | |
| 41 | # Default port for the pysvr application |
| 42 | PORT=4000 |
| 43 | |
| 44 | # Default target |
| 45 | all: pysvr |
| 46 | |
| 47 | # Target to build pysvr |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 48 | pysvr: pysvr.o $(PYOBJS) $(PYLIBS) |
| 49 | $(LINKCC) pysvr.o $(LIBS) -o pysvr |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 50 | |
| 51 | # Target to build and run pysvr |
| 52 | run: pysvr |
| 53 | pysvr $(PORT) |
| 54 | |
| 55 | # Target to clean up the directory |
| 56 | clean: |
| 57 | -rm -f pysvr *.o *~ core |