1 # Makefile to do general-coverage creation of dynamic-load libraries
2 # from python C-module sources.
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.
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:
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)
35 INCLDIR= $(prefix)/include/python
36 CFLAGS= $(OPT) -I$(INCLDIR) -I.. $(DEFS)
42 $(CC) -c $(CFLAGS) $(CPPFLAGS) $($*CFLAGS) -o $@ $<
45 $(LD) $(LDFLAGS) -o $@ $< $($*LDFLAGS) $(LOADLIBES)
47 PHONY: echo # For testing derivation of $(OBJS).
49 @echo "(Set SOURCES def if you don't see a '.so' for each '.c' between the brackets)"
54 ls $(OBJS) | cpio -pm $(DESTLIB)