|
1 | | -# Makefile for embedded Python use demo |
| 1 | +# Makefile for embedded Python use demo. |
| 2 | +# (This version tailored for CNRI and Solaris; edit lines marked with XXX.) |
2 | 3 |
|
3 | | -# Top of the build tree and source tree |
| 4 | +# XXX The compiler you are using |
| 5 | +CC= gcc |
| 6 | + |
| 7 | +# XXX Top of the build tree and source tree |
4 | 8 | blddir= ../.. |
5 | 9 | srcdir= ../.. |
6 | 10 |
|
| 11 | +# Python version |
| 12 | +VERSION= 1.5 |
| 13 | + |
7 | 14 | # Compiler flags |
8 | 15 | OPT= -g |
9 | 16 | INCLUDES= -I$(srcdir)/Include -I$(blddir) |
10 | | -DEFINES= -DHAVE_CONFIG_H |
11 | | -CFLAGS= $(OPT) $(DEFINES) $(INCLUDES) |
| 17 | +CFLAGS= $(OPT) $(INCLUDES) |
12 | 18 |
|
13 | | -# Libraries (must be in this order!) |
14 | | -MYLIBS= $(blddir)/Modules/libModules.a \ |
15 | | - $(blddir)/Python/libPython.a \ |
16 | | - $(blddir)/Objects/libObjects.a \ |
17 | | - $(blddir)/Parser/libParser.a |
| 19 | +# The Python library |
| 20 | +LIBPYTHON= $(blddir)/libpython$(VERSION).a |
18 | 21 |
|
19 | | -# XXX edit MODLIBS, LIBS and SYSLIBS to match $(blddir)/Modules/Makefile |
20 | | -MODLIBS= |
21 | | -LIBS= |
| 22 | +# XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile |
| 23 | +LIBS= -lsocket -lnsl -ldl -lreadline -ltermcap |
22 | 24 | SYSLIBS= -lm |
23 | | -ALLLIBS= $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) |
| 25 | +MODLIBS= |
| 26 | +ALLLIBS= $(LIBPYTHON) $(MODLIBS) $(LIBS) $(SYSLIBS) |
24 | 27 |
|
25 | 28 | # Build the demo application |
26 | 29 | all: demo |
27 | | -demo: demo.o config.o |
28 | | - $(CC) demo.o config.o $(ALLLIBS) -o demo |
29 | | - |
30 | | -# Build config.o, suppressing the main() function |
31 | | -config.o: $(blddir)/Modules/config.c |
32 | | - $(CC) $(CFLAGS) -DNO_MAIN -c $(blddir)/Modules/config.c |
| 30 | +demo: demo.o |
| 31 | + $(CC) demo.o $(ALLLIBS) -o demo |
33 | 32 |
|
34 | 33 | # Administrative targets |
35 | 34 |
|
|
0 commit comments