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

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