Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 1 | # Makefile for embedded Python use demo. |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 2 | # (This version tailored for my Red Hat Linux 6.1 setup; |
| 3 | # edit lines marked with XXX.) |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 4 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 5 | # XXX The compiler you are using |
| 6 | CC= gcc |
| 7 | |
| 8 | # XXX Top of the build tree and source tree |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 9 | blddir= ../../linux |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 10 | srcdir= ../.. |
| 11 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 12 | # Python version |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 13 | VERSION= 2.0 |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 14 | |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 15 | # Compiler flags |
| 16 | OPT= -g |
| 17 | INCLUDES= -I$(srcdir)/Include -I$(blddir) |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 18 | CFLAGS= $(OPT) $(INCLUDES) |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 19 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 20 | # The Python library |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 21 | LIBPYTHON= $(blddir)/libpython$(VERSION).a |
Guido van Rossum | 3caad8c | 1995-03-28 09:22:53 +0000 | [diff] [blame] | 22 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 23 | # XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 24 | LIBS= -lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil |
Guido van Rossum | c716684 | 2000-07-10 16:22:12 +0000 | [diff] [blame] | 25 | LDFLAGS= -Xlinker -export-dynamic |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 26 | SYSLIBS= -lm |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 27 | MODLIBS= |
| 28 | ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS) |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 29 | |
| 30 | # Build the demo application |
| 31 | all: demo |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 32 | demo: demo.o |
Guido van Rossum | c716684 | 2000-07-10 16:22:12 +0000 | [diff] [blame] | 33 | $(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 34 | |
| 35 | # Administrative targets |
| 36 | |
| 37 | test: demo |
| 38 | ./demo |
| 39 | |
| 40 | clean: |
| 41 | -rm -f *.o core |
| 42 | |
| 43 | clobber: clean |
| 44 | -rm -f *~ @* '#'* demo |