1# Makefile for embedded Python use demo. 2# (This version originally written on Red Hat Linux 6.1; 3# edit lines marked with XXX.) 4 5# XXX The compiler you are using 6CC= gcc 7 8# XXX Top of the build tree and source tree 9blddir= ../.. 10srcdir= ../.. 11 12# Python version 13VERSION= 2.7 14 15# Compiler flags 16OPT= -g 17INCLUDES= -I$(srcdir)/Include -I$(blddir) 18CFLAGS= $(OPT) 19CPPFLAGS= $(INCLUDES) 20 21# The Python library 22LIBPYTHON= $(blddir)/libpython$(VERSION).a 23 24# XXX edit LIBS (in particular) to match $(blddir)/Makefile 25LIBS= -lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil 26LDFLAGS= -Xlinker -export-dynamic 27SYSLIBS= -lm 28MODLIBS= 29ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS) 30 31# Build the demo applications 32all: demo loop importexc 33demo: demo.o 34 $(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo 35 36loop: loop.o 37 $(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop 38 39importexc: importexc.o 40 $(CC) $(LDFLAGS) importexc.o $(ALLLIBS) -o importexc 41 42# Administrative targets 43 44test: demo 45 ./demo 46 47COMMAND="print 'hello world'" 48looptest: loop 49 ./loop $(COMMAND) 50 51clean: 52 -rm -f *.o core 53 54clobber: clean 55 -rm -f *~ @* '#'* demo loop importexc 56 57realclean: clobber 58