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 |
Barry Warsaw | 7d23b59 | 2001-01-23 16:38:57 +0000 | [diff] [blame] | 9 | blddir= ../.. |
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 |
Fred Drake | ead36d7 | 2002-07-25 16:23:21 +0000 | [diff] [blame] | 13 | VERSION= 2.3 |
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) |
Neil Schemenauer | 89e90d6 | 2001-06-02 06:16:02 +0000 | [diff] [blame] | 18 | CFLAGS= $(OPT) |
| 19 | CPPFLAGS= $(INCLUDES) |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 20 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 21 | # The Python library |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 22 | LIBPYTHON= $(blddir)/libpython$(VERSION).a |
Guido van Rossum | 3caad8c | 1995-03-28 09:22:53 +0000 | [diff] [blame] | 23 | |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 24 | # XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile |
Guido van Rossum | 964f123 | 2000-07-10 14:35:12 +0000 | [diff] [blame] | 25 | LIBS= -lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil |
Guido van Rossum | c716684 | 2000-07-10 16:22:12 +0000 | [diff] [blame] | 26 | LDFLAGS= -Xlinker -export-dynamic |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 27 | SYSLIBS= -lm |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 28 | MODLIBS= |
| 29 | ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS) |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 30 | |
Fred Drake | ead36d7 | 2002-07-25 16:23:21 +0000 | [diff] [blame] | 31 | # Build the demo applications |
Barry Warsaw | d5221a3 | 2001-02-20 20:53:37 +0000 | [diff] [blame] | 32 | all: demo loop importexc |
Guido van Rossum | 6e614e3 | 1997-07-19 20:58:50 +0000 | [diff] [blame] | 33 | demo: demo.o |
Guido van Rossum | c716684 | 2000-07-10 16:22:12 +0000 | [diff] [blame] | 34 | $(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 35 | |
Guido van Rossum | 3559d1f | 2001-01-10 17:11:51 +0000 | [diff] [blame] | 36 | loop: loop.o |
| 37 | $(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop |
| 38 | |
Barry Warsaw | d5221a3 | 2001-02-20 20:53:37 +0000 | [diff] [blame] | 39 | importexc: importexc.o |
| 40 | $(CC) $(LDFLAGS) importexc.o $(ALLLIBS) -o importexc |
Barry Warsaw | e98626d | 2001-01-31 22:18:49 +0000 | [diff] [blame] | 41 | |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 42 | # Administrative targets |
| 43 | |
| 44 | test: demo |
| 45 | ./demo |
| 46 | |
Guido van Rossum | 3559d1f | 2001-01-10 17:11:51 +0000 | [diff] [blame] | 47 | COMMAND="print 'hello world'" |
| 48 | looptest: loop |
| 49 | ./loop $(COMMAND) |
| 50 | |
Guido van Rossum | 705d517 | 1994-10-08 19:30:50 +0000 | [diff] [blame] | 51 | clean: |
| 52 | -rm -f *.o core |
| 53 | |
| 54 | clobber: clean |
Barry Warsaw | d5221a3 | 2001-02-20 20:53:37 +0000 | [diff] [blame] | 55 | -rm -f *~ @* '#'* demo loop importexc |
| 56 | |
| 57 | realclean: clobber |