home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gdb-4.12.tar.gz / gdb-4.12.tar / gdb-4.12 / readline / Makefile.in < prev    next >
Makefile  |  1994-02-03  |  6KB  |  234 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. BISON = bison
  55. MAKEINFO = makeinfo
  56. RANLIB = ranlib
  57.  
  58. # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
  59. # a return type of "void" for signal handlers.
  60. TYPES = -DVOID_SIGHANDLER
  61.  
  62. # HP-UX compilation requires the BSD library.
  63. #LOCAL_LIBS = -lBSD
  64.  
  65. # Xenix compilation requires -ldir -lx
  66. #LOCAL_LIBS = -ldir -lx
  67.  
  68. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  69. # the vi line editing mode and features.
  70. READLINE_DEFINES = $(TYPES) -DVI_MODE
  71.  
  72. DEBUG_FLAGS = $(MINUS_G)
  73. LDFLAGS = $(DEBUG_FLAGS) 
  74.  
  75. # A good alternative is gcc -traditional.
  76. #CC = gcc -traditional
  77. RM = rm
  78. CP = cp
  79.  
  80. LOCAL_INCLUDES = -I$(srcdir)/../
  81.  
  82. CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
  83.        emacs_keymap.c vi_keymap.c
  84.  
  85. HSOURCES = readline.h chardefs.h history.h keymaps.h
  86. SOURCES  = $(CSOURCES) $(HSOURCES)
  87.  
  88. DOCUMENTATION = readline.texi inc-read.texi \
  89.         history.texi inc-hist.texi
  90.  
  91. SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
  92.  
  93. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  94.  
  95. FLAGS_TO_PASS = \
  96.     "prefix=$(prefix)" \
  97.     "exec_prefix=$(exec_prefix)" \
  98.     "against=$(against)" \
  99.     "MAKEINFO=$(MAKEINFO)" \
  100.     "INSTALL=$(INSTALL)" \
  101.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  102.     "INSTALL_DATA=$(INSTALL_DATA)"
  103.  
  104. SUBDIRS = doc
  105.  
  106. #### Host, target, and site specific Makefile fragments come in here.
  107. ###
  108.  
  109. .c.o:
  110.     $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
  111.  
  112. STAGESTUFF = *.o
  113.  
  114. all: libreadline.a
  115.  
  116. check:
  117. installcheck:
  118.  
  119. info dvi install-info clean-info clean-dvi: force
  120.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  121.  
  122. subdir_do: force
  123.     @for i in $(DODIRS); do \
  124.         if [ -f ./$$i/Makefile ] ; then \
  125.             if (cd ./$$i; \
  126.                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
  127.             else exit 1 ; fi ; \
  128.         else true ; fi ; \
  129.     done
  130.  
  131. history.info: $(srcdir)/history.texi
  132.     $(MAKEINFO) -o history.info $(srcdir)/history.texi
  133.  
  134. readline.info: $(srcdir)/readline.texi $(srcdir)/inc-read.texi
  135.     $(MAKEINFO) -o readline.info $(srcdir)/readline.texi
  136.  
  137. libreadline.a:    readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
  138.     $(RM) -f libreadline.a
  139.     $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
  140.     $(RANLIB) libreadline.a
  141.  
  142. readline.o:    readline.h chardefs.h  keymaps.h history.h readline.c vi_mode.c
  143. history.o:    history.c history.h
  144. funmap.o:    readline.h
  145. keymaps.o:    emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
  146.  
  147. tilde.o:    $(srcdir)/../glob/tilde.c
  148.     $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $(srcdir)/../glob/tilde.c
  149.  
  150. libtest:    libreadline.a libtest.c
  151.     $(CC) -o libtest $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) -L. libtest.c -lreadline -ltermcap
  152.  
  153. readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
  154.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  155.         $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
  156.          keymaps.o history.o vi_mode.o -L. -ltermcap
  157.  
  158. readline.tar:    $(THINGS_TO_TAR)
  159.         tar -cf readline.tar $(THINGS_TO_TAR)
  160.  
  161. readline.tar.Z:    readline.tar
  162.         compress -f readline.tar
  163.  
  164. install:
  165.         $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
  166.         $(RANLIB) $(libdir)/libreadline.a
  167.         $(INSTALL_DATA) $(srcdir)/readline.h $(includedir)/readline/readline.h
  168.         $(INSTALL_DATA) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
  169.         $(INSTALL_DATA) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
  170.  
  171. includes:
  172.         $(INSTALL_FILE) $(srcdir)/readline.h $(includedir)/readline/readline.h
  173.         $(INSTALL_FILE) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
  174.         $(INSTALL_FILE) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
  175.  
  176. local-clean:
  177.     rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
  178.     rm -f *.aux *.pg *.toc
  179.  
  180. mostlyclean: local-clean
  181.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  182.  
  183. clean: local-clean
  184.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  185.  
  186. distclean: local-clean
  187.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  188.     rm -f Makefile config.status sysdep.h
  189.  
  190. realclean: local-clean
  191.     @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
  192.     rm -f Makefile config.status sysdep.h
  193.  
  194. $(DESTDIR)/libreadline.a: libreadline.a
  195.  
  196. # Copy the object files from a particular stage into a subdirectory.
  197. stage1: force
  198.     -mkdir stage1
  199.     -mv $(STAGESTUFF) stage1
  200.  
  201. stage2: force
  202.     -mkdir stage2
  203.     -mv $(STAGESTUFF) stage2
  204.  
  205. stage3: force
  206.     -mkdir stage3
  207.     -mv $(STAGESTUFF) stage3
  208.  
  209. against=stage2
  210.  
  211. comparison: force
  212.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  213.  
  214. de-stage1: force
  215.     -(cd stage1 ; mv -f * ..)
  216.     -rmdir stage1
  217.  
  218. de-stage2: force
  219.     -(cd stage2 ; mv -f * ..)
  220.     -rmdir stage2
  221.  
  222. de-stage3: force
  223.     -(cd stage3 ; mv -f * ..)
  224.     -rmdir stage3
  225.  
  226. force:
  227.  
  228. # with the gnu make, this is done automatically.
  229.  
  230. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  231.     $(SHELL) ./config.status
  232.