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 | |
Guido van Rossum | 3559d1f | 2001-01-10 17:11:51 +0000 | [diff] [blame] | 35 | loop: loop.o |
| 36 | $(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop |
| 37 | |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 38 | # Administrative targets |
| 39 | |
| 40 | test: demo |
| 41 | ./demo |
| 42 | |
Guido van Rossum | 3559d1f | 2001-01-10 17:11:51 +0000 | [diff] [blame] | 43 | COMMAND="print 'hello world'" |
| 44 | looptest: loop |
| 45 | ./loop $(COMMAND) |
| 46 | |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 47 | clean: |
| 48 | -rm -f *.o core |
| 49 | |
| 50 | clobber: clean |
Guido van Rossum | 3559d1f | 2001-01-10 17:11:51 +0000 | [diff] [blame] | 51 | -rm -f *~ @* '#'* demo loop |