1997-07-19 20:58:50 +00:00
|
|
|
# Makefile for embedded Python use demo.
|
2000-07-10 14:35:12 +00:00
|
|
|
# (This version tailored for my Red Hat Linux 6.1 setup;
|
|
|
|
# edit lines marked with XXX.)
|
1994-10-08 19:30:50 +00:00
|
|
|
|
1997-07-19 20:58:50 +00:00
|
|
|
# XXX The compiler you are using
|
|
|
|
CC= gcc
|
|
|
|
|
|
|
|
# XXX Top of the build tree and source tree
|
2001-01-23 16:38:57 +00:00
|
|
|
blddir= ../..
|
1994-10-08 19:30:50 +00:00
|
|
|
srcdir= ../..
|
|
|
|
|
1997-07-19 20:58:50 +00:00
|
|
|
# Python version
|
2001-01-23 16:38:57 +00:00
|
|
|
VERSION= 2.1
|
1997-07-19 20:58:50 +00:00
|
|
|
|
1994-10-08 19:30:50 +00:00
|
|
|
# Compiler flags
|
|
|
|
OPT= -g
|
|
|
|
INCLUDES= -I$(srcdir)/Include -I$(blddir)
|
1997-07-19 20:58:50 +00:00
|
|
|
CFLAGS= $(OPT) $(INCLUDES)
|
1994-10-08 19:30:50 +00:00
|
|
|
|
1997-07-19 20:58:50 +00:00
|
|
|
# The Python library
|
2000-07-10 14:35:12 +00:00
|
|
|
LIBPYTHON= $(blddir)/libpython$(VERSION).a
|
1995-03-28 09:22:53 +00:00
|
|
|
|
1997-07-19 20:58:50 +00:00
|
|
|
# XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile
|
2000-07-10 14:35:12 +00:00
|
|
|
LIBS= -lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil
|
2000-07-10 16:22:12 +00:00
|
|
|
LDFLAGS= -Xlinker -export-dynamic
|
1994-10-08 19:30:50 +00:00
|
|
|
SYSLIBS= -lm
|
1997-07-19 20:58:50 +00:00
|
|
|
MODLIBS=
|
|
|
|
ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS)
|
1994-10-08 19:30:50 +00:00
|
|
|
|
|
|
|
# Build the demo application
|
2001-01-31 22:18:49 +00:00
|
|
|
all: demo loop import
|
1997-07-19 20:58:50 +00:00
|
|
|
demo: demo.o
|
2000-07-10 16:22:12 +00:00
|
|
|
$(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo
|
1994-10-08 19:30:50 +00:00
|
|
|
|
2001-01-10 17:11:51 +00:00
|
|
|
loop: loop.o
|
|
|
|
$(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop
|
|
|
|
|
2001-01-31 22:18:49 +00:00
|
|
|
import: import.o
|
|
|
|
$(CC) $(LDFLAGS) import.o $(ALLLIBS) -o import
|
|
|
|
|
1994-10-08 19:30:50 +00:00
|
|
|
# Administrative targets
|
|
|
|
|
|
|
|
test: demo
|
|
|
|
./demo
|
|
|
|
|
2001-01-10 17:11:51 +00:00
|
|
|
COMMAND="print 'hello world'"
|
|
|
|
looptest: loop
|
|
|
|
./loop $(COMMAND)
|
|
|
|
|
1994-10-08 19:30:50 +00:00
|
|
|
clean:
|
|
|
|
-rm -f *.o core
|
|
|
|
|
|
|
|
clobber: clean
|
2001-01-31 22:18:49 +00:00
|
|
|
-rm -f *~ @* '#'* demo loop import
|