home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / tools / workbench / fv-220 / makefile < prev    next >
Encoding:
Makefile  |  1998-01-18  |  6.8 KB  |  237 lines

  1. #
  2. # fv makefile for UNIX hosts
  3. #
  4. VERSION=220
  5.  
  6. #
  7. # Feature options:   (add to OPTIONS line)
  8. #    -DSTRICT_VI
  9. #        Typematic mode at prompt starts in editor state when defined,
  10. #        keys in search functions act more close to vi
  11. #    -DZERO_START
  12. #        '0' takes you to start of file rather than beginning of line
  13. #    -DEMACS_FEEL
  14. #        Give program more of Emacs feel, some compromise to vi feel
  15. #    -DALIGN_VIEW
  16. #        Always align the display address by current cursor size
  17. #    -DSHOW_EXTASCII
  18. #        Display ASCII codes 161-255 in viewer when defined
  19. #        This mode is not appreciated by all terminal types
  20. #    -DEDIT_MEMORY
  21. #        Enable memory edit functions
  22. #    -DCOLON_MODE
  23. #        Enable colon mode prompt
  24. #    -DHUGE_BUFFER
  25. #        Make the search buffer very large for screenless edits
  26. #    -DCOLOR_CURSES
  27. #        Use curses colors for different display regions.  This is
  28. #        not well-tested as color_xterm has curses emulation bugs.
  29. #    -DCURSES_UPDATE_BUG
  30. #        When displaying the screen, force buggy curses (Linux 2.0.29)
  31. #        to redraw screen rather than attempting to just update it.
  32. #
  33. # Target options:   (add to OPTIONS line)
  34. #    -DSolaris1           ** Should be automatically selected
  35. #        If compiling for Solaris 1.x (SunOS 4.x)
  36. #    -DSolaris2           ** Should be automatically selected
  37. #        If compiling for Solaris 2.x (SunOS 5.x)
  38. #    -DFreeBSD           ** Should be automatically selected
  39. #        If compiling for FreeBSD (need different make)
  40. #    -DLinux             ** Should be automatically selected
  41. #        If compiling for Linux
  42. #    -DAmiga             ** Should be automatically selected
  43. #        If compiling for AmigaDOS (no signal support)
  44. #        Amiga does not need -ltermcap with curses from S.J. Raybould
  45. #       Additional options may be -m68040 -m68881
  46. #    -DNetBSD
  47. #        If compiling for NetBSD
  48. #    -DHPUX
  49. #        If compiling for HP/HPUX (need different make or use cmdline)
  50. #    -DDynix
  51. #        If compiling for Dynix/BSD (Sequent - no cbreak mode)
  52. #    -DWin32
  53. #        If compiling for Windows 95 / NT  (use makefile.dos)
  54. #    -DOS9               (use makefile.os9)
  55. #        If compiling for OS-9/OS-9000, must also define HOST_ARCH=OS9
  56. #        Must also add -v=. -to=os9000 and -tp=<TARGET> to CFLAGS line
  57. #        Must also swap $(OBJS) compile comment lines
  58. #    -DLINT    Set if running lint on source (includes lint.h)
  59. #
  60. #
  61. #
  62. # To compile for extended curses key functions (like keypad) on SunOS 4.x:
  63. #    Add -I/usr/5include to CFLAGS and -L/usr/5lib to LDFLAGS, does not work
  64. #    currently due to other SYSV incompatibilities
  65. #
  66.  
  67. #OPTIONS=-DSTRICT_VI -DEDIT_MEMORY -DCOLON_MODE -DAmiga -m68040 -m68881
  68. OPTIONS=-DSTRICT_VI -DEDIT_MEMORY -DCOLON_MODE -DOS9
  69. #OPTIONS=-DSTRICT_VI -DCOLON_MODE -DCOLOR_CURSES
  70. OPTIONS=-DSTRICT_VI -DCOLON_MODE
  71.  
  72. # Only define for OS-9/OS-9000
  73. #HOST_ARCH=OS9
  74.  
  75.  
  76. #
  77. # Possible CC=
  78. #    CC=gcc
  79. #    CC=cc
  80. #    CC=acc
  81. #    CC=lint
  82. #    CC=xcc
  83. #CC=cc
  84. CC=gcc
  85.  
  86.  
  87. # Regular compiler CFLAGS which may be used:
  88. #    -ansi    Flag for ANSI language semantics (stricter checking)
  89. #    -Wall    Gcc flags for strict type checking
  90. #    -g      Debugging
  91. #    -O2     Optimization
  92.  
  93.  
  94. #  Optimized make
  95. CFLAGS=$(OPTIONS) -v=. -to=OS9000 -tp=80386        # OS-9/OS-9000
  96. CFLAGS=$(OPTIONS) -O
  97. #CFLAGS=$(OPTIONS) -O2 -fomit-frame-pointer -fstrength-reduce -fexpensive-optimizations -frerun-cse-after-loop
  98.  
  99. #  Debug make
  100. #CFLAGS=$(OPTIONS) -Wall
  101. #CFLAGS=$(OPTIONS) -g
  102.  
  103.  
  104. # Include flags
  105. #INCLUDE=-I/usr/5include
  106. INCLUDE=
  107.  
  108. # Linker flags
  109. #LDFLAGS=-L/usr/5lib
  110. LDFLAGS=
  111.  
  112. CCFLAGS = $(CFLAGS) $(INCLUDE)
  113.  
  114. ROOTDIR=/usr/local
  115. BINDIR=$(ROOTDIR)/bin
  116. MANDIR=$(ROOTDIR)/man
  117. MANEXT=1
  118.  
  119. LIBS=-lcurses -ltermcap
  120. AMIGALIBS=-lcurses
  121. OS9LIBS=-l=curses.l -l=termlib.l -l=sys_clib.l -l=unix.l
  122.  
  123. PROG=fv
  124. RM=rm -f
  125. #RM=del
  126. NROFF=groff -man
  127. NROFF=nroff -man
  128. PSROFF=psroff -t -man
  129. #PSROFF=ptroff -t -man
  130.  
  131. # OS-9/OS-9000 definitions
  132. O=r
  133. TO_O=-eas=
  134. TO_EXE=-fd=$(PROG)
  135.  
  136. # UNIX/Amiga definitions (these do not override previous with os9make)
  137. O=o
  138. TO_EXE=-o $(PROG)
  139. TO_O=-c -o
  140.  
  141. OBJDIR=obj$(HOST_ARCH)
  142. DOCDIR=doc
  143. SRCDIR=.
  144. MISC=Makefile makefile.dos makefile.os9 makefile.amiga \
  145.     INSTALL TODO RELNOTES fv-$(VERSION).lsm fv-$(VERSION).readme \
  146.     $(DOCDIR)/$(PROG).keymap $(DOCDIR)/$(PROG).man \
  147.     $(DOCDIR)/$(PROG).catman $(DOCDIR)/$(PROG).catman.ps
  148. INCLUDES=lint.h edit.h main.h screen.h pcurses.h curses.h io.h
  149. SRCS=$(SRCDIR)/main.c $(SRCDIR)/edit.c $(SRCDIR)/screen.c $(SRCDIR)/io.c \
  150.      $(SRCDIR)/search.c $(SRCDIR)/prompt.c $(SRCDIR)/help.c
  151. OBJS=$(OBJDIR)/main.$O $(OBJDIR)/edit.$O $(OBJDIR)/screen.$O $(OBJDIR)/io.$O \
  152.      $(OBJDIR)/search.$O $(OBJDIR)/prompt.$O $(OBJDIR)/help.$O
  153. #OBJS=$(SRCS:$(SRCDIR)%.c=$(OBJDIR)/%.$(O))
  154.  
  155. all:
  156.     @$(MAKE) -f Makefile host$(HOST_ARCH)
  157.  
  158. #\
  159. -b
  160.  
  161. host-sparc host-sun4: $(PROG) $(DOCDIR)/$(PROG).catman
  162.  
  163. host amiga: $(OBJDIR) $(OBJS) $(DOCDIR)/$(PROG).catman
  164. #    $(CC) -s $(CCFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(AMIGALIBS)
  165.     $(CC) $(CCFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(AMIGALIBS)
  166.  
  167. hostOS9: $(OBJDIR) $(OBJS) $(DOCDIR)/$(PROG).catman
  168.     $(CC) -s $(CCFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(OS9LIBS)
  169.  
  170. hostWin32: $(OBJDIR) $(OBJS)
  171.     $(CC) $(CFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(WIN32LIBS)
  172.  
  173. #    @echo MAKEFLAGS=$(MAKEFLAGS)
  174. #    @echo MAKE=$(MAKE)
  175. #    @echo SHELL=$(SHELL)
  176. #    @echo HOST_ARCH=$(HOST_ARCH)
  177. #    @echo HOST_MACH=$(HOST_MACH)
  178. #    @echo TARGET_MACH=$(TARGET_MACH)
  179.  
  180. $(PROG): $(OBJDIR) $(OBJS)
  181.     $(CC) $(CCFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(LIBS)
  182.  
  183. install: $(DOCDIR)/$(PROG).catman $(MANDIR) $(MANDIR)/man$(MANEXT) $(MANDIR)/cat$(MANEXT)
  184.     cp $(PROG) $(BINDIR)/$(PROG)
  185.     chmod 755 $(BINDIR)/$(PROG)
  186.     cp $(DOCDIR)/$(PROG).man    $(MANDIR)/man$(MANEXT)/$(PROG).$(MANEXT)
  187.     chmod 644 $(MANDIR)/man$(MANEXT)/$(PROG).$(MANEXT)
  188.     cp $(DOCDIR)/$(PROG).catman $(MANDIR)/cat$(MANEXT)/$(PROG).$(MANEXT)
  189.     chmod 644 $(MANDIR)/cat$(MANEXT)/$(PROG).$(MANEXT)
  190.  
  191. $(OBJDIR)/main.$(O):   $(SRCDIR)/main.c   main.h screen.h edit.h io.h
  192. $(OBJDIR)/edit.$(O):   $(SRCDIR)/edit.c   main.h screen.h edit.h
  193. $(OBJDIR)/screen.$(O): $(SRCDIR)/screen.c main.h screen.h pcurses.h io.h
  194. $(OBJDIR)/search.$(O): $(SRCDIR)/search.c main.h screen.h io.h
  195. $(OBJDIR)/prompt.$(O): $(SRCDIR)/prompt.c main.h screen.h io.h
  196. $(OBJDIR)/io.$(O):     $(SRCDIR)/io.c     main.h io.h
  197. $(OBJDIR)/help.$(O):   $(SRCDIR)/help.c   main.h screen.h
  198.  
  199. $(OBJS):
  200.     $(CC) $(CCFLAGS) $(SRCDIR)/$(@:$(OBJDIR)/%.$(O)=%.c) $(TO_O) $@
  201. # Use later line for OS9 and former for everything else
  202. #    $(CC) $(CCFLAGS) $*.c $(TO_O)$(OBJDIR)
  203.  
  204. $(OBJDIR) $(MANDIR) $(MANDIR)/man$(MANEXT) $(MANDIR)/cat$(MANEXT):
  205.     mkdir $@
  206.     chmod 755 $@
  207.  
  208. man: $(DOCDIR)/$(PROG).catman
  209. $(DOCDIR)/$(PROG).catman: $(DOCDIR)/$(PROG).man
  210.     -$(NROFF) $? >$@
  211.     -chmod 644 $@
  212.  
  213. ps: $(DOCDIR)/$(PROG).catman.ps
  214. $(DOCDIR)/$(PROG).catman.ps: $(DOCDIR)/$(PROG).man
  215.     -$(PSROFF) $? >$@
  216.  
  217. lint: clean
  218.     $(MAKE) -e CC=lint CFLAGS="-bh -DLINT $(LIBS)" $(OBJS)
  219.  
  220. Wall: clean
  221.     $(MAKE) -e CC=gcc CFLAGS="-Wall -DLINT" $(OBJS)
  222.  
  223. clean:
  224.     $(RM) $(OBJS)
  225.  
  226. lha:
  227.     $(RM) $(PROG)-$(VERSION).lha
  228.     lha a $(PROG)-$(VERSION).lha $(SRCS) $(INCLUDES) $(MISC)
  229.  
  230. zip:
  231.     $(RM) $(PROG)-$(VERSION).zip
  232.     zip $(PROG)-$(VERSION).zip $(SRCS) $(INCLUDES) $(MISC)
  233.  
  234. tgz:
  235.     $(RM) $(PROG)-$(VERSION).tgz
  236.     tar cf - $(SRCS) $(INCLUDES) $(MISC) | gzip -9 >$(PROG)-$(VERSION).tgz
  237.