home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / screen-3.5.1 / part02 / Makefile.in < prev    next >
Makefile  |  1993-08-08  |  11KB  |  312 lines

  1. #
  2. # Makefile template for screen 
  3. #
  4. # See machine dependant config.h for more configuration options.
  5. #
  6.  
  7. srcdir = @srcdir@
  8. VPATH = @srcdir@
  9.  
  10. # Where to install screen.
  11.  
  12. prefix = /usr/local
  13. exec_prefix = $(prefix)
  14.  
  15. bindir  = $(exec_prefix)/bin
  16. mandir  = $(prefix)/man
  17.  
  18. VERSION = @VERSION@
  19.  
  20. ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
  21.  
  22. CC = @CC@
  23. CFLAGS = -O
  24. LDFLAGS =
  25. LIBS = @LIBS@
  26.  
  27. CPP_DEPEND=/lib/cpp -MM
  28.  
  29. INSTALL = @INSTALL@
  30. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  31. INSTALL_DATA = @INSTALL_DATA@
  32.  
  33. AWK = @AWK@
  34.  
  35. ### Chose some debug configuration options:
  36. # -DDEBUG
  37. #    Turn on really heavy debug output. This is written to 
  38. #    /tmp/debug/screen.{front,back} Look at these files and quote 
  39. #    questionable sections when sending bug-reports to the author.
  40. # -DTMPTEST
  41. #    Change the socket directory to a location that does not interfere
  42. #    with the (suid-root) installed screen version. Use that in
  43. #    combination with -DDEBUG
  44. # -DDUMPSHADOW
  45. #    With shadow-pw screen would never dump core. Use this option if you
  46. #    still want to have a core. Use only for debugging.
  47. # -DFORKDEBUG
  48. #    Swap roles of father and son when forking the SCREEN process. 
  49. #    Useful only for debugging.
  50. OPTIONS=
  51. #OPTIONS= -DDEBUG -DTMPTEST
  52.  
  53.  
  54. ######
  55. ######
  56. ###### The following lines should be obsolete because of the 'configure' script.
  57. ######
  58. ######
  59.  
  60.  
  61. ### If you choose to compile with the tried and true:
  62. #CC= cc
  63. #CFLAGS= -O
  64. #CFLAGS= -g 
  65. ### gcc specific CFLAGS:
  66. #CC= gcc
  67. # If your system include files are bad, don't use -Wall
  68. #CFLAGS= -O6 -g #-Wall 
  69. #CFLAGS = -g -fstrength-reduce -fcombine-regs -finline-functions #-Wall
  70.  
  71. ### On some machines special CFLAGS are required:
  72. #M_CFLAGS=
  73. #M_CFLAGS= -Dapollo -A cpu,mathchip -A nansi    # Apollo DN3000/4000/4500
  74. #M_CFLAGS= -DBSDI                # bsd386
  75. #M_CFLAGS= -DISC -D_POSIX_SOURCE        # isc
  76. #M_CFLAGS= -systype bsd43 -DMIPS        # mips
  77. #M_CFLAGS= -fforce-mem -fforce-addr\
  78. # -fomit-frame-pointer -finline-functions -bsd     # NeXT
  79. #M_CFLAGS= -qlanglvl=ansi            # RS6000/AIX
  80. #M_CFLAGS= -qlanglvl=ansi -D_AIX32        # RS6000/AIX 3.2
  81. #M_CFLAGS= -ansi                # sgi/IRIX 3.x ansi 
  82. #M_CFLAGS= -xansi                # sgi/IRIX 4.x ext ansi 
  83. #M_CFLAGS= -YBSD                # Ultrix 4.x
  84. #M_CFLAGS= -DSVR4=1    # Bob Kline rvk@blink.att.com 80386 Unix SVR4.0
  85. #M_CFLAGS= -D_CX_UX    # Ken Beal kbeal@amber.ssd.csd.harris.com Harris CX/UX
  86.  
  87. ### Choose one of the LIBS setting below:
  88. #LIBS= -ltermcap -lc -lsocket -linet -lsec -lseq    # Sequent/ptx
  89. #LIBS= -ltermcap             # SunOS, Linux, Apollo,
  90. #                      gould_np1, NeXT, Ultrix
  91. #LIBS= -ltermcap -lelf            # SVR4
  92. #LIBS= -ltermlib -linet -lcposix    # isc
  93. #LIBS= -ltermcap -lmld            # mips (nlist is in mld)
  94. #LIBS= -ltermlib -lsun -lmld #-lc_s    # sgi/IRIX
  95. #LIBS= -lcurses                # RS6000/AIX
  96. #LIBS= -lcrypt_d -ltinfo        # sco32
  97. #LIBS= -lcrypt_i -ltinfo        # sco32
  98. #LIBS= -lcrypt -lsec            # sco322 (msilano@sra.com)
  99. #LIBS= -ltermcap -lcrypt.o -ldir -lx    # SCO XENIX 2.3.4
  100. #LIBS= -ltermcap -lcrypt -ldir -l2.3 -lx    # SCO UNIX XENIX cross dev.
  101. #LIBS= -ltermcap -lelf -lcrypt -lsocket -lnet -lnsl    # Bob Kline SVR4
  102.  
  103. ######
  104. ######
  105. ###### end of obsolete lines
  106. ######
  107. ######
  108.  
  109.  
  110. SHELL=/bin/sh
  111.  
  112. CFILES=    screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
  113.     search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
  114.     termcap.c input.c attacher.c pty.c process.c display.c comm.c acl.c
  115. OFILES=    screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
  116.     search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
  117.     termcap.o input.o attacher.o pty.o process.o display.o comm.o acl.o
  118.  
  119. all:    screen 
  120.  
  121. screen: $(OFILES)
  122.     $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
  123.  
  124. .c.o:
  125.     $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
  126.  
  127. install_bin: screen
  128.     $(INSTALL_PROGRAM) screen $(bindir)/screen-$(VERSION)
  129.     -chown root $(bindir)/screen-$(VERSION) && chmod 4755 $(bindir)/screen-$(VERSION)
  130. # This doesn't work if $(bindir)/screen is a symlink
  131.     -if [ -f $(bindir)/screen ] && [ ! -f $(bindir)/screen.old ]; then mv $(bindir)/screen $(bindir)/screen.old; fi
  132.     rm -f $(bindir)/screen
  133.     ln -s $(bindir)/screen-$(VERSION) $(bindir)/screen
  134.  
  135. install: install_bin
  136.     -$(INSTALL_DATA) $(srcdir)/etcscreenrc $(ETCSCREENRC)
  137.     -$(INSTALL_DATA) $(srcdir)/doc/screen.1 $(mandir)/man1/screen.1
  138.     -tic ${srcdir}/terminfo/screeninfo.src
  139. # Better do this by hand. E.g. under RCS...
  140. #    cat ${srcdir}/terminfo/screencap >> /etc/termcap
  141.     @echo termcap entry not installed.
  142.  
  143. installdirs: mkinstalldirs
  144. # Path leading to ETCSCREENRC and Socketdirectory not checked.
  145.     $(srcdir)/mkinstalldirs $(bindir) $(mandir)
  146.  
  147. uninstall:
  148.     rm -f $(bindir)/screen-$(VERSION)
  149.     rm -f $(bindir)/screen
  150.     mv $(bindir)/screen.old $(bindir)/screen
  151.     rm -f $(ETCSCREENRC)
  152.     rm -f $(mandir)/man1/screen.1
  153.  
  154. shadow:
  155.     mkdir shadow;
  156.     cd shadow; ln -s ../*.[ch] ../*.in ../*.sh ../configure ../doc ../terminfo .
  157.     rm -f shadow/term.h shadow/tty.c shadow/comm.h shadow/osdef.h
  158.  
  159. term.h: term.c term.sh
  160.     AWK=$(AWK) srcdir=$(srcdir) . $(srcdir)/term.sh
  161.  
  162. tty.c:    tty.sh 
  163.     sh $(srcdir)/tty.sh tty.c
  164.  
  165. comm.h: comm.c comm.sh config.h
  166.     AWK=$(AWK) CC="$(CC)" srcdir=${srcdir} . $(srcdir)/comm.sh
  167.  
  168. osdef.h: osdef.sh config.h osdef.h.in
  169.     CC="$(CC)" srcdir=${srcdir} . $(srcdir)/osdef.sh
  170.  
  171. docs:
  172.     cd doc; $(MAKE) dvi info
  173.  
  174. dvi info:
  175.     cd doc; $(MAKE) $@
  176.  
  177. mostlyclean:
  178.     rm -f $(OFILES) screen
  179.  
  180. clean celan: mostlyclean
  181.     rm -f tty.c term.h comm.h osdef.h
  182.  
  183. # Delete all files from the current directory that are created by 
  184. # configuring or building the program.
  185. # building of term.h/comm.h requires awk. Keep it in the distribution
  186. # we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC.
  187. distclean:    mostlyclean
  188.     rm -f screen-$(VERSION).tar screen-$(VERSION).TZ
  189.     rm -f config.status Makefile
  190.  
  191. # Delete everything from the current directory that can be
  192. # reconstructed with this Makefile.
  193. realclean:    distclean
  194.     rm -f config.h
  195.  
  196. TAGS: $(CFILES)
  197.     ctags $(CFILES) *.h
  198.     ctags -e $(CFILES) *.h
  199.  
  200. dist: screen-$(VERSION).tar.z
  201.  
  202. screen-$(VERSION).tar: term.h comm.h tty.c
  203.     -rm -rf dist
  204.     mkdir dist
  205.     mkdir dist/screen-$(VERSION)
  206.     ln acl.h ansi.h display.h extern.h mark.h os.h overlay.h \
  207.        patchlevel.h rcs.h screen.h window.h osdef.h.in \
  208.        term.sh tty.sh comm.sh osdef.sh newsyntax \
  209.        acl.c ansi.c attacher.c comm.c display.c window.c fileio.c help.c \
  210.        input.c loadav.c mark.c misc.c process.c pty.c putenv.c \
  211.        screen.c search.c socket.c term.c termcap.c utmp.c resize.c \
  212.        ChangeLog COPYING INSTALL NEWS \
  213.        dist/screen-$(VERSION)
  214.     ln configure.in configure dist/screen-$(VERSION)
  215.     sed -e 's@"/local/screens@"/tmp/screens@' -e 's@"/local@"/usr/local@g' < config.h.in > dist/screen-$(VERSION)/config.h.in
  216.     sed -e 's@[     ]/local@ /usr/local@g' -e 's/^CFLAGS = -g/CFLAGS = -O/' < Makefile.in > dist/screen-$(VERSION)/Makefile.in
  217.     ln term.h dist/screen-$(VERSION)/term.h.dist
  218.     ln comm.h dist/screen-$(VERSION)/comm.h.dist
  219.     ln tty.c dist/screen-$(VERSION)/tty.c.dist
  220.     ln README dist/screen-$(VERSION)/README
  221.     mkdir dist/screen-$(VERSION)/terminfo
  222.     cd terminfo; ln 8bits README checktc.c screen-sco.mail screencap \
  223.       screeninfo.src test.txt tetris.c \
  224.       ../dist/screen-$(VERSION)/terminfo
  225.     sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/screen-$(VERSION)/etcscreenrc 
  226.     cp $(HOME)/.iscreenrc dist/screen-$(VERSION)/.iscreenrc
  227.     mkdir dist/screen-$(VERSION)/doc
  228.     ln doc/fdpat.ips dist/screen-$(VERSION)/doc/fdpat.ps
  229.     sed -e 's@/local/emacs@/usr/local@g' < doc/Makefile.in > dist/screen-$(VERSION)/doc/Makefile.in
  230.     cd doc; ln screen.1 screen.texinfo \
  231.       ../dist/screen-$(VERSION)/doc
  232.     cd dist; tar chf ../screen-$(VERSION).tar screen-$(VERSION)
  233.     rm -rf dist
  234.  
  235. screen-$(VERSION).tar.z: screen-$(VERSION).tar
  236.     gzip -f screen-$(VERSION).tar
  237.  
  238. # Perform self-tests (if any).
  239. check:
  240.  
  241. lint:
  242.     lint -I. $(CFILES)
  243.  
  244. saber:
  245.     #load $(CFLAGS) screen.c ansi.c $(LIBS)
  246.  
  247. mdepend: $(CFILES) term.h
  248.     @rm -f DEPEND ; \
  249.     for i in ${CFILES} ; do \
  250.       echo "$$i" ; \
  251.       echo `echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
  252.             cc -E $$i |\
  253.             grep '^# .*"\./.*\.h"' |\
  254.             sort -t'"' -u +1 -2 |\
  255.             sed -e 's/.*"\.\/\(.*\)".*/\1/'\
  256.           ` >> DEPEND ; \
  257.     done
  258.  
  259.  
  260. depend: $(CFILES) term.h
  261.     cp Makefile Makefile~
  262.     sed -e '/\#\#\# Dependencies/q' < Makefile > tmp_make
  263.     for i in $(CFILES); do echo $$i; $(CPP_DEPEND) $$i >> tmp_make; done 
  264.     mv tmp_make Makefile
  265.  
  266. screen.o socket.o: Makefile
  267.  
  268. ### Dependencies:
  269. screen.o: screen.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  270.   display.h window.h patchlevel.h extern.h osdef.h
  271. ansi.o: ansi.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  272.   display.h window.h extern.h osdef.h
  273. fileio.o: fileio.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  274.   display.h window.h extern.h osdef.h
  275. mark.o: mark.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  276.   display.h window.h mark.h extern.h osdef.h
  277. misc.o: misc.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  278.   display.h window.h extern.h osdef.h
  279. resize.o: resize.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  280.   display.h window.h extern.h osdef.h
  281. socket.o: socket.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  282.   display.h window.h extern.h osdef.h
  283. search.o: search.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  284.   display.h window.h mark.h extern.h osdef.h
  285. tty.o: tty.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  286.   display.h window.h extern.h osdef.h
  287. term.o: term.c rcs.h term.h 
  288. window.o: window.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  289.   display.h window.h extern.h osdef.h
  290. utmp.o: utmp.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  291.   display.h window.h extern.h osdef.h
  292. loadav.o: loadav.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  293.   display.h window.h extern.h osdef.h
  294. putenv.o: putenv.c rcs.h config.h 
  295. help.o: help.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  296.   display.h window.h extern.h osdef.h
  297. termcap.o: termcap.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h \
  298.   term.h display.h window.h extern.h osdef.h
  299. input.o: input.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  300.   display.h window.h extern.h osdef.h
  301. attacher.o: attacher.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h \
  302.   term.h display.h window.h extern.h osdef.h
  303. pty.o: pty.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  304.   display.h window.h extern.h osdef.h
  305. process.o: process.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h \
  306.   term.h display.h window.h extern.h osdef.h
  307. display.o: display.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h \
  308.   term.h display.h window.h extern.h osdef.h
  309. comm.o: comm.c rcs.h config.h comm.h 
  310. acl.o: acl.c rcs.h config.h screen.h os.h ansi.h comm.h overlay.h term.h \
  311.   display.h window.h extern.h acl.h osdef.h
  312.