Commit e8c0a156 authored by Guido van Rossum's avatar Guido van Rossum

New generic makefile by Jim F; drop pyimenu.el

parent b4d37791
# Makefile to do general-coverage creation of dynamic-load libraries
# from python C-module sources.
# $Id$
# Created by Ken Manheimer, Jul-1994. ken.manheimer@nist.gov, 301 975-3539
# To configure for your site, select the appropriate SOURCES and macro
# def and assign the right path to the prefix macro.
ARCH= sun4
prefix= /depot/sundry
DESTLIB= $(prefix)/lib/python/$(ARCH)
### For Sun Make; tested in v 1.0, under both SunOS 4.1.3 and SunOS 5.3:
#SOURCES:sh= echo *.c
### For Gnu Make; works at least for v 3.59:
SOURCES= $(wildcard *.c)
# To configure for a new module:
# - put the module in the current directory
# - if it doesn't require any special compile or load options, that's it.
# - if it does require special compile or load options, create a macro
# composed of the (full) module name, sans suffix, plus 'CFLAGS' or
# 'LDFLAGS', depending on the compile phase in question.
metalbasemoduleCFLAGS= -I$(prefix)/include/mbase51 -DNO_TIMEB -DNO_USHORT -DNO_ENCRYPT
metalbasemoduleLDFLAGS= -L/depot/sundry/plat/lib -lmb
cursesmoduleCFLAGS= -I/usr/5include
cursesmoduleLDFLAGS= -L/usr/5lib -lcurses -ltermcap
OBJS= $(SOURCES:.c=.so)
CC= gcc
OPT= -g -O
DEFS= -DHAVE_CONFIG_H
INCLDIR= $(prefix)/include/python
CFLAGS= $(OPT) -I$(INCLDIR) -I.. $(DEFS)
LD= ld
all: $(OBJS)
%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $($*CFLAGS) -o $@ $<
%.so: %.o
$(LD) $(LDFLAGS) -o $@ $< $($*LDFLAGS) $(LOADLIBES)
PHONY: echo # For testing derivation of $(OBJS).
echo:
@echo "(Set SOURCES def if you don't see a '.so' for each '.c' between the brackets)"
@echo :$(OBJS):
PHONY : install
install: $(OBJS)
ls $(OBJS) | cpio -pm $(DESTLIB)
PHONY : clean
clean:
rm -f *.o *.so
# Generic Makefile for dynamically linked extension modules.
#
# Jim Fulton, Digital Creations, jim@digicool.com
# Uncomment this line if you want to fix the location of the PYTHON
# installation. Otherwise, set the environment variable before using this
# Makefile.
# $(PYTHONHOME)= /usr/local/
# The following lines should be left as is:
pyinstalldir= $(PYTHONHOME)
installdir= $(PYTHONHOME)
exec_installdir=$(pyinstalldir)
INCLUDEPY= $(pyinstalldir)/include/Py
LIBP= $(exec_installdir)/lib/python
LIBPL= $(LIBP)/lib
PYMAKE= make -f $(LIBPL)/Makefile
# LIBSO is the location of platform-dependent dynamically linked
# extension libraries. This can be handy when you need to build
# shared libraries that are not extensions but want to store them
# with other extensions and need to know where they are.
# Leave this line as it is.
LIBSO= `$(PYMAKE) -s echodestshared`
# Put your module name here:
MODULE=your-module
# Put the object files for your module here:
OBS=$(MODULE).o
# Put extra linker options, such as libraries here:
EXTRA=
# If you have any Python modules, include them here, so that they
# can be installed.
PYMODULES=
build:
if [ "$(MODULE)" != your-module ]; then \
$(PYMAKE) INCLDIR=$(INCLUDEPY) CONFIGINCLDIR=$(LIBPL) \
ASHAREDMODULE=$(MODULE) \
'ASHAREDMODULESOBS=$(OBS)' \
'ASHAREDMODULESEXTRA=$(EXTRA)' \
asharedmodule; \
fi
install: installso installpy
installso: build
if [ "$(MODULE)" != your-module ]; then \
$(PYMAKE) exec_prefix=$(installdir) \
ASHAREDMODULE=$(MODULE) asharedinstall; \
fi
installpy:
for m in $(PYMODULES) the-end; do \
if [ "$$m" != the-end ]; then \
python -c "import $$m"; \
cp $$m.pyc $(installdir)/lib/python/; \
fi; \
done
clean::
-rm -f *.o *.so *~ *# so_locations
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment