view readline/Makefile.in @ 2056:3e7017491d3f

[project @ 1996-04-07 04:43:37 by jwe]
author jwe
date Sun, 07 Apr 1996 04:43:37 +0000
parents 4f218c8d6ec7
children 2d352d57a5ab
line wrap: on
line source

## -*- text -*- ####################################################
#								   #
# Makefile for the GNU Readline and History Libraries.		   #
#								   #
####################################################################

srcdir = @srcdir@
VPATH = @srcdir@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

CC = @CC@
CFLAGS = @CFLAGS@

CPICFLAG = @CPICFLAG@

SHLEXT = @SHLEXT@

SHARED_LIBS = @SHARED_LIBS@

LIBS_TO_INSTALL = libreadline.a libhistory.a \
	libreadline.$(SHLEXT) libhistory.$(SHLEXT)

RANLIB = @RANLIB@
AR = ar
RM = rm
CP = cp
MV = mv

# See the file STANDALONE for the -D defines that readline understands
DEFS = @DEFS@
# For libraries which include headers from other libraries.
LOCAL_INCLUDES = -I. -I..

ALL_CFLAGS = $(LOCAL_INCLUDES) $(DEFS) $(CFLAGS)

# Here is a rule for making .o files from .c files that doesn't force
# the type of the machine (like -sun3) into the flags.

%.o : %.c
	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<

pic/%.o : %.c
	$(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o $@

# ==================== Where To Install Things ====================

# The default location for installation.  Everything is placed in
# subdirectories of this directory.  The default values for many of
# the variables below are expressed in terms of this one, so you may
# not need to change them.  This defaults to /usr/local.
prefix = @prefix@

# Like `prefix', but used for architecture-specific files.
exec_prefix = @exec_prefix@

# Where to install binaries that people will want to run directly.
bindir = @bindir@

# Where to install architecture-independent data files.
datadir = @datadir@

# Where to install the libraries.
libdir = @libdir@

# Where to install readline's include files.  The default is
# ${prefix}/include/readline
includedir = @includedir@

# Where to install readline's man pages, and what extension they should
# have.  The default is ${prefix}/man/man1
mandir = @mandir@
manext = 1

# Where to install and expect the info files describing readline
infodir = @infodir@

# The name of the main library target.
LIBRARY_NAME = libreadline.a

# The C code source files for this library.
CSOURCES = bind.c complete.c display.c emacs_keymap.c funmap.c \
	history.c isearch.c keymaps.c parens.c readline.c rltty.c \
	search.c signals.c tilde.c vi_keymap.c vi_mode.c xmalloc.c

# The header files for this library.
HSOURCES := ansi_stdlib.h chardefs.h config.h history.h keymaps.h \
	memalloc.h posixstat.h readline.h rlconf.h rldefs.h tilde.h 

OBJECTS := readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
	  rltty.o complete.o bind.o isearch.o display.o signals.o \
	  history.o tilde.o xmalloc.o

HIST_OBJ := history.o

ifeq ($(SHARED_LIBS), true)
  ifdef CPICFLAG
    PICOBJ := $(addprefix pic/, $(OBJECTS))
    HIST_PICOBJ := $(addprefix pic/, $(HIST_OBJ))
  else
    PICOBJ := $(OBJECTS)
    HIST_PICOBJ := $(HIST_OBJ)
  endif
endif

DISTFILES = $(CSOURCES) $(HSOURCES) Makefile.in configure.in \
	configure README STANDALONE COPYING config.h.in

SUBDIRS = doc examples

# The texinfo files which document this library.
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
DOCOBJECT = doc/readline.dvi
DOCSUPPORT = doc/Makefile
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)

SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*

SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)

THINGS_TO_TAR = $(SOURCES) $(SUPPORT)

##########################################################################

all: stamp-picdir libreadline.a libhistory.a stamp-readline stamp-history

stamp-picdir:
	if [ -n "$(CPICFLAG)" ]; then \
	  if [ -d pic ]; then true; else mkdir pic ; fi ; \
	else true; fi
	touch stamp-picdir

libreadline.a: $(OBJECTS)
	$(RM) -f $@
	$(AR) cq $@ $(OBJECTS)
	-[ -n "$(RANLIB)" ] && $(RANLIB) $@

libhistory.a: history.o
	$(RM) -f $@
	$(AR) cq $@ history.o
	-[ -n "$(RANLIB)" ] && $(RANLIB) $@

stamp-readline:
	if $(SHARED_LIBS); then \
	  $(CC) -shared -o libreadline.$(SHLEXT) $(PICOBJ) -ltermcap; \
	fi
	touch stamp-readline

stamp-history:
	if $(SHARED_LIBS); then \
	  $(CC) -shared -o libhistory.$(SHLEXT) $(HIST_PICOBJ); \
	fi
	touch stamp-history

documentation: force
	[ ! -d doc ] && mkdir doc
	(if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS); fi)

force:

# For Octave:

install:
	for f in $(LIBS_TO_INSTALL); do \
	  if [ -f $$f ]; then $(INSTALL_DATA) $$f $(libdir)/$$f; fi; \
	done

uninstall:

# The rule for 'includes' is written funny so that the if statement
# always returns TRUE unless there really was an error installing the
# include files.
#install: installdirs libreadline.a
#	${INSTALL_DATA} readline.h keymaps.h chardefs.h history.h \
#		$(incdir)/readline
#	-${MV} $(libdir)/libreadline.a $(libdir)/libreadline.old
#	${INSTALL_DATA} libreadline.a $(bindir)/libreadline.a
#	-[ -n "$(RANLIB)" ] && $(RANLIB) -t $(bindir)/libreadline.a
#
#installdirs:
#	[ ! -d $(incdir)/readline ] && { \
#	  mkdir $(incdir)/readline && chmod chmod 755 $(incdir)/readline; }
#
#uninstall:
#	cd $(incdir)/readline && ${RM} -f ${INSTALLED_HEADERS}
#	cd $(libdir) && ${RM} -f libreadline.a libreadline.old

tags:	force
	etags $(CSOURCES) $(HSOURCES)

TAGS:	force
	ctags -x $(CSOURCES) $(HSOURCES) > $@

readline: readline.h rldefs.h chardefs.h
readline: $(OBJECTS)
	$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -DTEST -o readline \
	  readline.c bind.o complete.o display.o funmap.o history.o \
	  isearch.o keymaps.o parens.o rltty.o search.o signals.o \
	tilde.o vi_mode.o xmalloc.o -ltermcap

clean:
	$(RM) -f $(OBJECTS) libreadline.a libhistory.a
	(if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi)
	if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi

maintainer-clean realclean distclean mostlyclean: clean
	(if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi)
	rm -f Makefile config.log config.status

local-dist:
	for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/readline/$$dir; cd $$dir; $(MAKE) $@; cd ..; done
	ln $(DISTFILES) ../`cat ../.fname`/readline
.PHONY: local-dist

dist:
	for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/readline/$$dir; cd $$dir; $(MAKE) $@; cd ..; done
	ln $(DISTFILES) ../`cat ../.fname`/readline
.PHONY: dist

# Dependencies
readline.o: readline.c readline.h rldefs.h rlconf.h chardefs.h
readline.o: keymaps.h history.h
vi_mode.o:  rldefs.h rlconf.h readline.h history.h
funmap.o:   funmap.c readline.h rlconf.h
keymaps.o:  keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h rlconf.h
history.o: history.h memalloc.h
isearch.o: memalloc.h readline.h history.h
search.o: memalloc.h readline.h history.h
display.o: readline.h history.h rldefs.h rlconf.h
complete.o: readline.h rldefs.h rlconf.h
rltty.o: rldefs.h rlconf.h readline.h
bind.o: rldefs.h rlconf.h readline.h history.h
signals.o: rldefs.h rlconf.h readline.h history.h
parens.o: readline.h