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 | |
| 14 | # Where Python is installed, and which version |
| 15 | INST=/usr/local |
| 16 | VER=1.5 |
| 17 | |
| 18 | # Expressions using the above definitions -- no need to change |
| 19 | PYVER=python$(VER) |
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 | a88446a | 1997-07-19 21:34:11 +0000 | [diff] [blame] | 21 | PYC=$(INST)/lib/$(PYVER)/config |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 22 | PYINCL=-I$(INST)/include/$(PYVER) -I$(PYC) |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 23 | PYLIBS=$(PYC)/lib$(PYVER).a |
| 24 | # Use these defs when compiling against built Python |
| 25 | ##PYINCL=-I../../Include -I../../sparc |
| 26 | ##PYLIBS=../../sparc/lib$(PYVER).a |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 27 | |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 28 | # Libraries to link with -- very installation dependent |
Guido van Rossum | a88446a | 1997-07-19 21:34:11 +0000 | [diff] [blame] | 29 | # (See LIBS= in Modules/Makefile in build tree) |
| 30 | RLLIBS=-lreadline -ltermcap |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 31 | OTHERLIBS=-lsocket -lnsl -lpthread -ldl -lm |
| 32 | |
| 33 | # Compilation and link flags -- no need to change normally |
| 34 | CFLAGS=$(PYINCL) $(OPT) |
| 35 | LIBS=$(PYLIBS) $(RLLIBS) $(OTHERLIBS) |
| 36 | |
| 37 | # Default port for the pysvr application |
| 38 | PORT=4000 |
| 39 | |
| 40 | # Default target |
| 41 | all: pysvr |
| 42 | |
| 43 | # Target to build pysvr |
Guido van Rossum | 20abb4e | 1997-08-14 19:48:42 +0000 | [diff] [blame] | 44 | pysvr: pysvr.o $(PYOBJS) $(PYLIBS) |
| 45 | $(LINKCC) pysvr.o $(LIBS) -o pysvr |
Guido van Rossum | 5c8b991 | 1997-07-19 21:00:47 +0000 | [diff] [blame] | 46 | |
| 47 | # Target to build and run pysvr |
| 48 | run: pysvr |
| 49 | pysvr $(PORT) |
| 50 | |
| 51 | # Target to clean up the directory |
| 52 | clean: |
| 53 | -rm -f pysvr *.o *~ core |