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