summaryrefslogtreecommitdiffstats
path: root/Demo/embed/Makefile
blob: 0a4b4343bfd16e05f0b3864b1da5b6cc6b98f50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Makefile for embedded Python use demo.
# (This version tailored for my Red Hat Linux 6.1 setup;
# edit lines marked with XXX.)

# XXX The compiler you are using
CC=	 	gcc

# XXX Top of the build tree and source tree
blddir=		../..
srcdir=		../..

# Python version
VERSION=	2.1

# Compiler flags
OPT=		-g
INCLUDES=	-I$(srcdir)/Include -I$(blddir)
CFLAGS=		$(OPT) $(INCLUDES)

# The Python library
LIBPYTHON=	$(blddir)/libpython$(VERSION).a

# XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile
LIBS=		-lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil
LDFLAGS=	-Xlinker -export-dynamic
SYSLIBS=	-lm
MODLIBS=	
ALLLIBS=	$(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS)

# Build the demo application
all:		demo loop import
demo:		demo.o
		$(CC) $(LDFLAGS) demo.o $(ALLLIBS) -o demo

loop:		loop.o
		$(CC) $(LDFLAGS) loop.o $(ALLLIBS) -o loop

import:		import.o
		$(CC) $(LDFLAGS) import.o $(ALLLIBS) -o import

# Administrative targets

test:		demo
		./demo

COMMAND="print 'hello world'"
looptest:	loop
		./loop $(COMMAND)

clean:
		-rm -f *.o core

clobber:	clean
		-rm -f *~ @* '#'* demo loop import