(py-electric-colon): use a save-excursion instead of a progn in
[python/dscho.git] / Misc / dlMakefile
blob0a69f2de985c7fc10217faa1f3d08507e708da08
1 # Makefile to do general-coverage creation of dynamic-load libraries
2 # from python C-module sources.
4 # $Id$
5 # Created by Ken Manheimer, Jul-1994.  ken.manheimer@nist.gov, 301 975-3539
7 # To configure for your site, select the appropriate SOURCES and macro
8 # def and assign the right path to the prefix macro.
10 ARCH=           sun4
11 prefix=         /depot/sundry
12 DESTLIB=        $(prefix)/lib/python/$(ARCH)
14 ### For Sun Make; tested in v 1.0, under both SunOS 4.1.3 and SunOS 5.3:
15 #SOURCES:sh=    echo *.c
16 ### For Gnu Make; works at least for v 3.59:
17 SOURCES=        $(wildcard *.c)
19 # To configure for a new module:
20 #  - put the module in the current directory
21 #  - if it doesn't require any special compile or load options, that's it.
22 #  - if it does require special compile or load options, create a macro
23 #    composed of the (full) module name, sans suffix, plus 'CFLAGS' or
24 #    'LDFLAGS', depending on the compile phase in question.
25 metalbasemoduleCFLAGS=  -I$(prefix)/include/mbase51 -DNO_TIMEB -DNO_USHORT -DNO_ENCRYPT
26 metalbasemoduleLDFLAGS= -L/depot/sundry/plat/lib -lmb
27 cursesmoduleCFLAGS=  -I/usr/5include
28 cursesmoduleLDFLAGS= -L/usr/5lib -lcurses -ltermcap
30 OBJS=           $(SOURCES:.c=.so)
32 CC=             gcc
33 OPT=            -g -O
34 DEFS=           -DHAVE_CONFIG_H
35 INCLDIR=        $(prefix)/include/python
36 CFLAGS=         $(OPT) -I$(INCLDIR) -I.. $(DEFS)
37 LD=             ld
39 all:    $(OBJS)
41 %.o: %.c
42         $(CC) -c $(CFLAGS) $(CPPFLAGS) $($*CFLAGS) -o $@ $<
44 %.so: %.o
45         $(LD) $(LDFLAGS) -o $@ $< $($*LDFLAGS) $(LOADLIBES)
47 PHONY: echo             # For testing derivation of $(OBJS).
48 echo:
49         @echo "(Set SOURCES def if you don't see a '.so' for each '.c' between the brackets)"
50         @echo :$(OBJS):
52 PHONY : install
53 install:        $(OBJS)
54         ls $(OBJS) | cpio -pm $(DESTLIB)
56 PHONY : clean
57 clean:
58         rm -f *.o *.so