home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / TOOLS / _TOOLS.TAR / usr / doc / tools-2.16 / example / Makefile < prev    next >
Encoding:
Makefile  |  1994-08-03  |  2.8 KB  |  98 lines

  1. ##  $Revision: 1.3 $
  2. ##
  3. ##  Unix makefile for editline library.
  4. ##
  5.  
  6. ##  Set your options:
  7. ##    -DANSI_ARROWS        ANSI arrows keys work like emacs.
  8. ##    -DHAVE_STDLIB        Have <stdlib.h>.
  9. ##    -DHAVE_TCGETATTR    Have tcgetattr(), tcsetattr().
  10. ##    -DHIDE            Make static functions static (non debug).
  11. ##    -DHIST_SIZE=n        History size.
  12. ##    -DNEED_STRDUP        Don't have strdup().
  13. ##    -DUNIQUE_HISTORY    Don't save command if same as last one.
  14. ##    -DUSE_DIRENT        Use <dirent.h>, not <sys/dir.h>?
  15. ##    -DUSE_TERMCAP        Use the termcap library for terminal size
  16. ##                see LDFLAGS, below, if you set this.
  17. ##    -DNEED_PERROR        Don't have perror() (used in testit)
  18. DEFS    = -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX -DUSE_TERMCAP
  19.  
  20. ##  Set your C compiler:
  21. #WARN    = -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \
  22. #    -Wunused -Wcomment -Wswitch
  23. #CC    = gcc -ansi $(WARN)
  24. #CC    = cc
  25. CFLAGS    = $(DEFS) -O #-g
  26.  
  27. #  This stuff is for the Linux jump table version.
  28. CC    = gcc -B/usr/bin/jump
  29. JUMP_DIR = ./jump/
  30. JUMP_LIB = libedit
  31. LD_LIBRARY_PATH=/usr/lib:/lib:./
  32.  
  33. #The following line only works with newer versions of Make.
  34. #If Make barfs on this, comment it out.
  35. export JUMP_DIR JUMP_LIB LD_LIBRARY_PATH
  36.  
  37. ADDRESS = 0x80000000
  38. JUMPSIZE = 0x4000
  39. GOTSIZE  = 0x2000
  40. MAJOR= 0
  41. MINOR = 2
  42. VERSION = $(MAJOR).$(MINOR)
  43. IMAGE = libedit
  44.  
  45. ##  If you have -DUSE_TERMCAP, set this as appropriate:
  46. #LDFLAGS = -ltermlib
  47. LDFLAGS = -ltermcap
  48.  
  49. ##  Set ranlib as appropriate:
  50. RANLIB    = ranlib
  51. #RANLIB    = echo
  52.  
  53. ##  End of configuration.
  54.  
  55. SOURCES    = editline.c complete.c sysunix.c version.c
  56. OBJECTS    = editline.o complete.o sysunix.o version.o
  57. SHARFILES =    README Makefile editline.3 editline.h unix.h editline.c \
  58.         complete.c sysunix.c testit.c \
  59.         Make.os9 os9.h sysos9.c
  60.  
  61. all:        libedit.a image stubs testit
  62.     @echo ======= Executable 'testit' demonstrates shared libraries.
  63.     @echo ======= Environment variable LD_LIBRARY_PATH must be set
  64.     @echo ======= properly for example to run.
  65.     @echo ======= Now running testit...
  66.     ./testit
  67.  
  68. image:        $(IMAGE).so.$(VERSION)
  69. $(IMAGE).so.$(VERSION): $(OBJECTS)
  70.     mkimage -l $(IMAGE) -v $(VERSION) -a $(ADDRESS) -j $(JUMPSIZE) -g $(GOTSIZE) -- $(OBJECTS) -ltermcap -lc `gcc --print-libgcc-file-name` -lc
  71.  
  72. stubs:        libedit.sa
  73. libedit.sa:
  74.     mkstubs -l $(IMAGE) -v $(VERSION) -a $(ADDRESS) -j $(JUMPSIZE)  -g $(GOTSIZE) -- libedit
  75.  
  76. testit:        testit.c libedit.a
  77.     cc $(CFLAGS) -o testit testit.c libedit.sa $(LDFLAGS)
  78.  
  79. shar:        $(SHARFILES)
  80.     shar $(SHARFILES) >shar
  81.  
  82. clean:
  83.     rm -f *.[oa] testit foo core tags lint lint.all a.out shar *.sa libedit.so.$(VERSION)
  84.  
  85. lint:        testit
  86.     lint -a -b -u -x $(DEFS) $(SOURCES) testit.c >lint.all
  87.     sed -e '/warning: function prototype not in scope/d' \
  88.         -e '/warning: old style argument declaration/'d \
  89.         -e '/mix of old and new style function declaration/'d \
  90.         <lint.all >lint
  91.  
  92. libedit.a:    $(OBJECTS)
  93.     @rm -f $@
  94.     ar r $@ $(OBJECTS)
  95.     $(RANLIB) $@
  96.  
  97. $(OBJECTS):    editline.h
  98.