home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gdb-4.16-base.tgz / gdb-4.16-base.tar / fsf / gdb / readline / Makefile.in < prev    next >
Makefile  |  1995-10-10  |  7KB  |  250 lines

  1. #
  2. # Makefile
  3. #   Copyright (C) 1990, 1991, 1992 Free Software Foundation
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16. #
  17.  
  18. #
  19. # Makefile for readline and history libraries.
  20. #
  21.  
  22. srcdir = .
  23.  
  24. prefix = /usr/local
  25.  
  26. exec_prefix = $(prefix)
  27. bindir = $(exec_prefix)/bin
  28. libdir = $(exec_prefix)/lib
  29.  
  30. datadir = $(prefix)/lib
  31. mandir = $(prefix)/man
  32. man1dir = $(mandir)/man1
  33. man2dir = $(mandir)/man2
  34. man3dir = $(mandir)/man3
  35. man4dir = $(mandir)/man4
  36. man5dir = $(mandir)/man5
  37. man6dir = $(mandir)/man6
  38. man7dir = $(mandir)/man7
  39. man8dir = $(mandir)/man8
  40. man9dir = $(mandir)/man9
  41. infodir = $(prefix)/info
  42. includedir = $(prefix)/include
  43. docdir = $(datadir)/doc
  44.  
  45. SHELL = /bin/sh
  46.  
  47. INSTALL = install -c
  48. INSTALL_PROGRAM = $(INSTALL)
  49. INSTALL_DATA = $(INSTALL)
  50.  
  51. AR = ar
  52. AR_FLAGS = qv
  53. CFLAGS = -g
  54. MAKEINFO = makeinfo
  55. RANLIB = ranlib
  56.  
  57. # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
  58. # a return type of "void" for signal handlers.
  59. TYPES = -DVOID_SIGHANDLER
  60.  
  61. # HP-UX compilation requires the BSD library.
  62. #LOCAL_LIBS = -lBSD
  63.  
  64. # Xenix compilation requires -ldir -lx
  65. #LOCAL_LIBS = -ldir -lx
  66.  
  67. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  68. # the vi line editing mode and features.
  69. READLINE_DEFINES = $(TYPES) -DVI_MODE
  70.  
  71. DEBUG_FLAGS = $(MINUS_G)
  72. LDFLAGS = $(DEBUG_FLAGS) 
  73.  
  74. # A good alternative is gcc -traditional.
  75. #CC = gcc -traditional
  76. RM = rm
  77. CP = cp
  78.  
  79. LOCAL_INCLUDES = -I$(srcdir)/../
  80.  
  81. # The name of the main library target.
  82. LIBRARY_NAME = libreadline.a
  83.  
  84. # The C code source files for this library.
  85. CSOURCES = readline.c funmap.c keymaps.c vi_mode.c parens.c search.c \
  86.        rltty.c complete.c bind.c isearch.c display.c signals.c \
  87.        emacs_keymap.c vi_keymap.c history.c tilde.c xmalloc.c
  88.  
  89. # The header files for this library.
  90. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h \
  91.        posixstat.h tilde.h
  92.  
  93. OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
  94.       rltty.o complete.o bind.o isearch.o display.o signals.o \
  95.       history.o tilde.o xmalloc.o
  96.  
  97. SOURCES  = $(CSOURCES) $(HSOURCES)
  98.  
  99. DOCUMENTATION = readline.texi inc-read.texi \
  100.         history.texi inc-hist.texi
  101.  
  102. SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
  103.  
  104. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  105.  
  106. FLAGS_TO_PASS = \
  107.     "prefix=$(prefix)" \
  108.     "exec_prefix=$(exec_prefix)" \
  109.     "against=$(against)" \
  110.     "MAKEINFO=$(MAKEINFO)" \
  111.     "INSTALL=$(INSTALL)" \
  112.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  113.     "INSTALL_DATA=$(INSTALL_DATA)"
  114.  
  115. SUBDIRS = doc
  116.  
  117. #### Host, target, and site specific Makefile fragments come in here.
  118. ###
  119.  
  120. .c.o:
  121.     $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
  122.  
  123. STAGESTUFF = *.o
  124.  
  125. all: libreadline.a
  126.  
  127. check:
  128. installcheck:
  129.  
  130. info dvi install-info clean-info clean-dvi: force
  131.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  132.  
  133. TAGS: force
  134.     etags $(srcdir)/*.h $(srcdir)/*.c
  135.  
  136. subdir_do: force
  137.     @for i in $(DODIRS); do \
  138.         if [ -f ./$$i/Makefile ] ; then \
  139.             if (cd ./$$i; \
  140.                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
  141.             else exit 1 ; fi ; \
  142.         else true ; fi ; \
  143.     done
  144.  
  145. libreadline.a: $(OBJECTS)
  146.     $(RM) -f libreadline.a
  147.     $(AR) $(AR_FLAGS) libreadline.a $(OBJECTS)
  148.     $(RANLIB) libreadline.a
  149.  
  150. bind.o: bind.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h history.h 
  151. complete.o: complete.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h 
  152. display.o: display.c rldefs.h readline.h keymaps.h chardefs.h history.h 
  153. funmap.o: funmap.c sysdep.h readline.h keymaps.h chardefs.h 
  154. history.o: history.c sysdep.h history.h chardefs.h 
  155. isearch.o: isearch.c readline.h keymaps.h chardefs.h history.h 
  156. keymaps.o: keymaps.c sysdep.h readline.h keymaps.h chardefs.h emacs_keymap.c vi_keymap.c 
  157. parens.o: parens.c readline.h keymaps.h chardefs.h 
  158. readline.o: readline.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h history.h 
  159. rltty.o: rltty.c rldefs.h readline.h keymaps.h chardefs.h 
  160. search.o: search.c readline.h keymaps.h chardefs.h history.h 
  161. signals.o: signals.c rldefs.h readline.h keymaps.h chardefs.h history.h 
  162. tilde.o: tilde.c sysdep.h tilde.h chardefs.h 
  163. vi_mode.o: vi_mode.c rldefs.h readline.h keymaps.h chardefs.h history.h 
  164. xmalloc.o: xmalloc.c 
  165.  
  166. libtest:    libreadline.a libtest.c
  167.     $(CC) -o libtest $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) -L. libtest.c -lreadline -ltermcap
  168.  
  169. readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
  170.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  171.         $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
  172.          keymaps.o history.o vi_mode.o -L. -ltermcap
  173.  
  174. readline.tar:    $(THINGS_TO_TAR)
  175.         tar -cf readline.tar $(THINGS_TO_TAR)
  176.  
  177. readline.tar.Z:    readline.tar
  178.         compress -f readline.tar
  179.  
  180. install:
  181.         $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
  182.         $(RANLIB) $(libdir)/libreadline.a
  183.         $(INSTALL_DATA) $(srcdir)/readline.h $(includedir)/readline/readline.h
  184.         $(INSTALL_DATA) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
  185.         $(INSTALL_DATA) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
  186.  
  187. includes:
  188.         $(INSTALL_FILE) $(srcdir)/readline.h $(includedir)/readline/readline.h
  189.         $(INSTALL_FILE) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
  190.         $(INSTALL_FILE) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
  191.  
  192. local-clean:
  193.     rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
  194.     rm -f *.aux *.pg *.toc
  195.  
  196. mostlyclean: local-clean
  197.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  198.  
  199. clean: local-clean
  200.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  201.  
  202. distclean: local-clean
  203.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  204.     rm -f Makefile config.status sysdep.h
  205.  
  206. realclean maintainer-clean: local-clean
  207.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  208.     rm -f Makefile config.status sysdep.h
  209.  
  210. $(DESTDIR)/libreadline.a: libreadline.a
  211.  
  212. # Copy the object files from a particular stage into a subdirectory.
  213. stage1: force
  214.     -mkdir stage1
  215.     -mv $(STAGESTUFF) stage1
  216.  
  217. stage2: force
  218.     -mkdir stage2
  219.     -mv $(STAGESTUFF) stage2
  220.  
  221. stage3: force
  222.     -mkdir stage3
  223.     -mv $(STAGESTUFF) stage3
  224.  
  225. against=stage2
  226.  
  227. comparison: force
  228.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  229.  
  230. de-stage1: force
  231.     -(cd stage1 ; mv -f * ..)
  232.     -rmdir stage1
  233.  
  234. de-stage2: force
  235.     -(cd stage2 ; mv -f * ..)
  236.     -rmdir stage2
  237.  
  238. de-stage3: force
  239.     -(cd stage3 ; mv -f * ..)
  240.     -rmdir stage3
  241.  
  242. force:
  243.  
  244. # with the gnu make, this is done automatically.
  245.  
  246. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  247.     $(SHELL) ./config.status
  248.