home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyth_os2.zip / python-1.0.2 / readline / Makefile < prev    next >
Makefile  |  1994-01-06  |  4KB  |  125 lines

  1. ## -*- text -*- ####################################################
  2. #                                   #
  3. # Makefile for readline and history libraries.               #
  4. # Hacked by Guido to have it all in one directory and allow VPATH. #
  5. #                                   #
  6. ####################################################################
  7.  
  8. # Here is a rule for making .o files from .c files that doesn't force
  9. # the type of the machine (like -sun3) into the flags.
  10. .c.o:
  11.     $(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) \
  12.         $(READLINE_DEFINES) $(CPPFLAGS) $*.c
  13.  
  14. # Destination installation directory.  The libraries are copied to DESTDIR
  15. # when you do a `make install', and the header files to INCDIR/readline/*.h.
  16. DESTDIR = /usr/local/lib
  17. INCDIR = /usr/local/include
  18.  
  19. # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
  20. # a return type of "void" for signal handlers.
  21. TYPES = -DVOID_SIGHANDLER
  22.  
  23. # Define USG as -DUSG if you are using a System V operating system.
  24. #USG = -DUSG
  25.  
  26. # HP-UX compilation requires the BSD library.
  27. #LOCAL_LIBS = -lBSD
  28.  
  29. # Xenix compilation requires -ldir -lx
  30. #LOCAL_LIBS = -ldir -lx
  31.  
  32. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  33. # the vi line editing mode and features.  Make sure to comment out the
  34. # definition of VI if you remove the -DVI_MODE.
  35. READLINE_DEFINES = $(TYPES) -DVI_MODE
  36.  
  37. DEBUG_FLAGS = -g
  38. LDFLAGS = $(DEBUG_FLAGS) 
  39. CFLAGS = $(DEBUG_FLAGS) $(USG) -I.
  40.  
  41. # A good alternative is gcc -traditional.
  42. #CC = gcc -traditional
  43. CC = cc
  44. RANLIB = ranlib
  45. AR = ar
  46. RM = rm
  47. CP = cp
  48.  
  49. LOCAL_INCLUDES = -I../
  50.  
  51. CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
  52.        emacs_keymap.c vi_keymap.c xmalloc.c tilde.c alloca.c
  53.  
  54. HSOURCES = readline.h chardefs.h history.h keymaps.h
  55. SOURCES  = $(CSOURCES) $(HSOURCES)
  56.  
  57. OBJECTS = readline.o vi_mode.o history.o funmap.o keymaps.o \
  58.       xmalloc.o tilde.o alloca.o
  59.  
  60. DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo \
  61.         doc/hist.texinfo doc/hsuser.texinfo doc/hstech.texinfo
  62. DOCOBJECT = doc/readline.dvi doc/history.dvi
  63. DOCSUPPORT = doc/Makefile doc/texinfo.tex
  64. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  65.  
  66. SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog examples
  67.  
  68. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  69.  
  70. ##########################################################################
  71.  
  72. all: libreadline.a
  73.  
  74. libreadline.a:    $(OBJECTS)
  75.     $(RM) -f $@
  76.     $(AR) clq $@ $(OBJECTS)
  77.     @echo never mind if the ranlib fails -- probably System V
  78.     -$(RANLIB) libreadline.a
  79.  
  80. readline: readline.h chardefs.h $(OBJECTS)
  81.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  82.       $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
  83.       tilde.o xmalloc.o keymaps.o history.o -L. -ltermcap
  84.  
  85. readline.o:    readline.c readline.h chardefs.h  keymaps.h history.h
  86. history.o:    history.c history.h
  87. vi_mode.o:    vi_mode.c
  88. funmap.o:    funmap.c readline.h
  89. keymaps.o:    keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h
  90. tilde.o:    tilde.c
  91. xmalloc.o:    xmalloc.c
  92. alloca.o:    alloca.c
  93.  
  94. documentation: force
  95.     (cd doc; make)
  96. force:
  97.  
  98. readline.tar:    $(THINGS_TO_TAR)
  99.     tar -cf readline.tar $(THINGS_TO_TAR)
  100.  
  101. readline.tar.Z:    readline.tar
  102.     compress -f readline.tar
  103.  
  104. install:    $(DESTDIR)/libreadline.a includes
  105.  
  106. # The rule for 'includes' is written funny so that the if statement
  107. # always returns TRUE unless there really was an error installing the
  108. # include files.
  109. includes:
  110.     if [ -r $(INCDIR)/readline ]; then \
  111.       :; \
  112.     else \
  113.       mkdir $(INCDIR)/readline && chmod a+r $(INCDIR)/readline; \
  114.     fi
  115.     $(CP) readline.h keymaps.h chardefs.h $(INCDIR)/readline/
  116. clean:
  117.     rm -f $(OBJECTS) *.a
  118. #    (cd doc; make clean)
  119. clobber: clean
  120.  
  121. $(DESTDIR)/libreadline.a: libreadline.a
  122.     -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
  123.     cp libreadline.a $(DESTDIR)/libreadline.a
  124.     if [ -f "$(RANLIB)" ]; then $(RANLIB) -t $(DESTDIR)/libreadline.a; fi
  125.