home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / rc / part01 / Makefile < prev    next >
Encoding:
Makefile  |  1991-10-18  |  3.5 KB  |  117 lines

  1. # Makefile for rc.
  2.  
  3. # Check the definitions in stddef.h and the configuration parameters below
  4. # to make sure they are correct for your system.
  5.  
  6. # Configuration parameters for rc:
  7. # Configurations may be added or deleted using ed; e.g., the ed command
  8. # for adding the NODIRENT configuration would be
  9. # /#NODIRENT/s/^.//
  10. #
  11. # Note that config.h automatically sets up configurations for some
  12. # systems.
  13.  
  14. # Define the macro NODIRENT if your system has <sys/dir.h> but not
  15. # <dirent.h>. (e.g., NeXT-OS)
  16. #NODIRENT    = -DNODIRENT
  17.  
  18. # Define the macro DEVFD if your system supports /dev/fd.
  19. #DEVFD        = -DDEVFD
  20.  
  21. # Define the macro NOLIMITS if your system does not support Berkeley
  22. # limits.
  23. #NOLIMITS    = -DNOLIMITS
  24.  
  25. # Define the macro NOSIGCLD if your system uses SIGCLD in the System
  26. # V way. (e.g., Irix)
  27. #NOSIGCLD    = -DNOSIGCLD
  28.  
  29. # Define the macro READLINE if you want rc to call GNU readline
  30. # instead of read(2) on interactive shells.
  31. #READLINE    = -DREADLINE
  32.  
  33. # Define the macro NOEXECVE if your Unix does not interpret #! in the
  34. # kernel, and set EXECVE to execve.o.
  35. #NOEXECVE    = -DNOEXECVE
  36. #EXECVE        = execve.o
  37.  
  38. # Define the macro ADDON if you wish to extend rc via locally-defined
  39. # builtins. An interface is provided in addon.[ch]. Note that the author
  40. # does not endorse any such extensions, rather hopes that this way
  41. # rc will become useful to more people.
  42. #ADDON        = addon.o
  43.  
  44. # If you want rc to default to some interpreter for files which don't
  45. # have a legal #! on the first line, define the macro DEFAULTINTERP.
  46. #DEFAULTINTERP    = -DDEFAULTINTERP=\"/bin/sh\"
  47.  
  48. # If your /bin/sh (or another program you care about) rejects
  49. # environment variables with special characters in them, rc can put
  50. # out ugly variable names using [_0-9a-zA-Z] that encode the real
  51. # name; define PROTECT_ENV for this hack.
  52. #PROTECT_ENV    = -DPROTECT_ENV
  53.  
  54. # If your window system has a broken terminal emulator (and I'm talking
  55. # specifically about the NeXT here) which expects your shell to do csh-
  56. # like job control stuff on startup, define PROTECT_JOB so that rc can
  57. # do the "right" thing.
  58. #PROTECT_JOB    = -DPROTECT_JOB
  59.  
  60. CONFIG = $(NODIRENT) $(NOCMDARG) $(DEVFD) $(NOLIMITS) $(NOSIGCLD) \
  61.     $(READLINE) $(NOEXECVE)    $(DEFAULTINTERP) $(PROTECT_ENV) $(PROTECT_JOB)
  62.  
  63. # Use an ANSI compiler (or at least one that groks prototypes and void *):
  64. CC=gcc -g -O
  65. CFLAGS=$(CONFIG)
  66. LDFLAGS=
  67.  
  68. # Use bison if you will, but yacc generates a smaller y.tab.c, and the speed
  69. # of the parser is largely irrelevant in a shell.
  70. YACC=yacc
  71.  
  72. OBJS =  $(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \
  73.     glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \
  74.     nalloc.o open.o redir.o sigmsgs.o status.o tree.o utils.o var.o \
  75.     version.o wait.o walk.o which.o y.tab.o
  76.  
  77. # If rc is compiled with GNU readline, you must supply the correct arguments to
  78. # ld on this line. Typically this would be something like:
  79. #
  80. #    $(CC) -o rc $(OBJS) -lreadline -ltermcap
  81.  
  82. rc: $(OBJS)
  83.     $(CC) -o rc $(OBJS)
  84.  
  85. sigmsgs.c: mksignal
  86.     sh mksignal /usr/include/sys/signal.h
  87.  
  88. y.tab.c: parse.y
  89.     $(YACC) -d parse.y
  90.  
  91. clean:
  92.     rm -f a.* *.o *.s core *.tab.* *.out
  93.  
  94. history: history.c
  95.     $(CC) -o ./- history.c
  96.     rm -f ./-- ./-p ./--p
  97.     ln -s ./- ./--
  98.     ln -s ./- ./-p
  99.     ln -s ./- ./--p
  100.  
  101. C: force
  102.     -mkdir C
  103.     for i in *.c; do awk -f cfix.awk $$i >C/$$i; done
  104.     for i in *.h; do awk -f hfix.awk $$i >C/$$i; done
  105.     sed 's/CFLAGS=/&-Dconst= /' Makefile > C/Makefile
  106.     cp mksignal *.y C
  107.  
  108. force:
  109.  
  110. # dependencies:
  111.  
  112. sigmsgs.h: sigmsgs.c
  113. lex.o y.tab.o: y.tab.c
  114. builtins.c fn.c status.c hash.c: sigmsgs.h
  115.