home *** CD-ROM | disk | FTP | other *** search
Makefile | 1998-01-17 | 6.1 KB | 217 lines |
- #
- # fv makefile
- #
-
- #
- # Feature options: (add to OPTIONS line)
- # -DSTRICT_VI
- # Typematic mode at prompt starts in editor state when defined,
- # keys in search functions act more close to vi
- # -DZERO_START
- # '0' takes you to start of file rather than beginning of line
- # -DEMACS_FEEL
- # Give program more of Emacs feel, some compromise to vi feel
- # -DALIGN_VIEW
- # Always align the display address by current cursor size
- # -DSHOW_EXTASCII
- # Display ASCII codes 161-255 in viewer when defined
- # This mode is not appreciated by all terminal types
- # -DEDIT_MEMORY
- # Enable memory edit functions
- # -DCOLON_MODE
- # Enable colon mode prompt
- # -DHUGE_BUFFER
- # Make the search buffer very large for screenless edits
- # -DCOLOR_CURSES
- # Use curses colors for different display regions. This is
- # not well-tested as color_xterm has curses emulation bugs.
- #
- # Target options: (add to OPTIONS line)
- # -DSolaris1 ** Should be automatically selected
- # If compiling for Solaris 1.x (SunOS 4.x)
- # -DSolaris2 ** Should be automatically selected
- # If compiling for Solaris 2.x (SunOS 5.x)
- # -DFreeBSD ** Should be automatically selected
- # If compiling for FreeBSD (curses name compatibility)
- # -DLinux ** Should be automatically selected
- # If compiling for Linux (curses name compatibility)
- # -DOS9 ** Should be automatically selected
- # If compiling for OS-9/OS-9000, must also define HOST_ARCH=OS9
- # Must also add -v=. -to=os9000 and -tp=<TARGET> to CFLAGS line
- # Must also swap $(OBJS) compile comment lines
- # -DAmiga
- # If compiling for AmigaDOS (no signal support)
- # Amiga does not need -ltermcap with curses from S.J. Raybould
- # Additional options may be -m68040 -m68881
- # -DNetBSD
- # If compiling for NetBSD (curses name compatibility)
- # -DDynix
- # If compiling for Dynix/BSD (Sequent - no cbreak mode)
- # -DLINT Set if running lint on source (includes lint.h)
- #
- #
- #
- # To compile for extended curses key functions (like keypad) on BSD SunOS:
- # Add -I/usr/5include to CFLAGS and -L/usr/5lib to LDFLAGS, does not work
- # currently due to other SYSV incompatibilities
- #
-
- #OPTIONS=-DSTRICT_VI -DEDIT_MEMORY -DCOLON_MODE -DAmiga -m68040 -m68881
- OPTIONS=-DSTRICT_VI -DEDIT_MEMORY -DCOLON_MODE -DOS9
- #OPTIONS=-DSTRICT_VI -DCOLON_MODE -Wall -DCOLOR_CURSES
- OPTIONS=-DSTRICT_VI -DCOLON_MODE -DEDIT_MEMORY
-
- # Only define for OS-9/OS-9000
- HOST_ARCH=OS9
-
-
- #
- # Possible CC=
- # CC=gcc
- # CC=cc
- # CC=acc
- # CC=lint
- # CC=xcc
- CC=cc
- #CC=gcc
-
-
- # Regular compiler CFLAGS which may be used:
- # -ansi Flag for ANSI language semantics (stricter checking)
- # -Wall Gcc flags for strict type checking
- # -g Debugging
- # -O2 Optimization
-
- # Normal make
- CFLAGS=$(OPTIONS) -v=. -to=OS9000 -tp=80386
- CFLAGS=$(OPTIONS)
- # Optimized make
- #CFLAGS=-Wall -DLINT
- #CFLAGS=-O2 -fomit-frame-pointer -fstrength-reduce -fexpensive-optimizations -frerun-cse-after-loop
- CFLAGS=$(OPTIONS) -g
-
-
- # Include flags
- #INCLUDE=-I/usr/5include
- INCLUDE=
-
- # Linker flags
- #LDFLAGS=-L/usr/5lib
- #LDFLAGS=
- LDFLAGS=
-
- CFLAGS += $(INCLUDE)
-
- ROOTDIR=/usr/local
- BINDIR=$(ROOTDIR)/bin
- MANDIR=$(ROOTDIR)/man
- MANEXT=1
-
- LIBS=-lcurses -ltermcap
- AMIGALIBS=-lcurses
- OS9LIBS=-l=curses.l -l=termlib.l -l=sys_clib.l -l=unix.l
-
- PROG=fv
- RM=rm -f
- #RM=del
- NROFF=groff -man
- NROFF=nroff -man
- PSROFF=psroff -t -man
- #PSROFF=ptroff -t -man
-
- # OS-9/OS-9000 definitions
- O=r
- TO_O=-eas=
- TO_EXE=-fd=$(PROG)
-
- # UNIX/Amiga definitions (these do not override previous with os9make)
- O=o
- TO_EXE=-o $(PROG)
- TO_O=-c -o
-
- OBJDIR=obj$(HOST_ARCH)
- DOCDIR=doc
- SRCDIR=.
- MISC=Makefile todo relnotes $(DOCDIR)/$(PROG).keymap $(DOCDIR)/$(PROG).man \
- $(DOCDIR)/$(PROG).catman $(DOCDIR)/$(PROG).catman.ps
- INCLUDES=lint.h edit.h main.h screen.h pcurses.h curses.h io.h
- SRCS=$(SRCDIR)/main.c $(SRCDIR)/edit.c $(SRCDIR)/screen.c $(SRCDIR)/io.c \
- $(SRCDIR)/search.c $(SRCDIR)/prompt.c $(SRCDIR)/help.c
- OBJS=$(OBJDIR)/main.$O $(OBJDIR)/edit.$O $(OBJDIR)/screen.$O $(OBJDIR)/io.$O \
- $(OBJDIR)/search.$O $(OBJDIR)/prompt.$O $(OBJDIR)/help.$O
- #OBJS=$(SRCS:$(SRCDIR)%.c=$(OBJDIR)/%.$(O))
-
- all:
- @$(MAKE) -f Makefile host$(HOST_ARCH)
-
- # os9make needs -b option \
- -b
-
- host-sparc host-sun4: $(PROG) $(DOCDIR)/$(PROG).catman
-
- host amiga: $(OBJDIR) $(OBJS) $(DOCDIR)/$(PROG).catman
- # $(CC) -s $(CFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(AMIGALIBS)
- $(CC) $(CFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(AMIGALIBS)
-
- hostOS9: $(OBJDIR) $(OBJS) $(DOCDIR)/$(PROG).catman
- $(CC) -s $(CFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(OS9LIBS)
-
- # @echo MAKEFLAGS=$(MAKEFLAGS)
- # @echo MAKE=$(MAKE)
- # @echo SHELL=$(SHELL)
- # @echo HOST_ARCH=$(HOST_ARCH)
- # @echo HOST_MACH=$(HOST_MACH)
- # @echo TARGET_MACH=$(TARGET_MACH)
-
- $(PROG): $(OBJDIR) $(OBJS)
- $(CC) $(CFLAGS) $(TO_EXE) $(OBJS) $(LDFLAGS) $(LIBS)
-
- install: $(DOCDIR)/$(PROG).catman $(MANDIR) $(MANDIR)/man$(MANEXT) $(MANDIR)/cat$(MANEXT)
- cp $(PROG) $(BINDIR)/$(PROG)
- chmod 755 $(BINDIR)/$(PROG)
- cp $(DOCDIR)/$(PROG).man $(MANDIR)/man$(MANEXT)/$(PROG).$(MANEXT)
- chmod 644 $(MANDIR)/man$(MANEXT)/$(PROG).$(MANEXT)
- cp $(DOCDIR)/$(PROG).catman $(MANDIR)/cat$(MANEXT)/$(PROG).$(MANEXT)
- chmod 644 $(MANDIR)/cat$(MANEXT)/$(PROG).$(MANEXT)
-
- $(OBJDIR)/main.$(O): $(SRCDIR)/main.c main.h screen.h edit.h io.h
- $(OBJDIR)/edit.$(O): $(SRCDIR)/edit.c main.h screen.h edit.h
- $(OBJDIR)/screen.$(O): $(SRCDIR)/screen.c main.h screen.h pcurses.h io.h
- $(OBJDIR)/search.$(O): $(SRCDIR)/search.c main.h screen.h io.h
- $(OBJDIR)/prompt.$(O): $(SRCDIR)/prompt.c main.h screen.h io.h
- $(OBJDIR)/io.$(O): $(SRCDIR)/io.c main.h io.h
- $(OBJDIR)/help.$(O): $(SRCDIR)/help.c main.h screen.h
-
- $(OBJS):
- # $(CC) $(CFLAGS) $(SRCDIR)/$(@:$(OBJDIR)/%.$(O)=%.c) $(TO_O) $@
- # Use later line for OS9 and former for everything else
- $(CC) $(CFLAGS) $*.c $(TO_O)$(OBJDIR)
-
- $(OBJDIR) $(MANDIR) $(MANDIR)/man$(MANEXT) $(MANDIR)/cat$(MANEXT):
- mkdir $@
- chmod 755 $@
-
- man: $(DOCDIR)/$(PROG).catman
- $(DOCDIR)/$(PROG).catman: $(DOCDIR)/$(PROG).man
- -$(NROFF) $? >$@
- -chmod 644 $@
-
- ps: $(DOCDIR)/$(PROG).catman.ps
- $(DOCDIR)/$(PROG).catman.ps: $(DOCDIR)/$(PROG).man
- -$(PSROFF) $? >$@
-
- lint: clean
- $(MAKE) -e CC=lint CFLAGS="-bh -DLINT $(LIBS)" $(OBJS)
-
- Wall: clean
- $(MAKE) -e CC=gcc CFLAGS="-Wall -DLINT" $(OBJS)
-
- clean:
- $(RM) $(OBJS)
-
- lha:
- lha a $(PROG).lha $(SRCS) $(INCLUDES) $(MISC)
-
- zip:
- zip $(PROG).zip $(SRCS) $(INCLUDES) $(MISC)
-