#		fm   --   file modifier
#             Copyright (c) Tony Field 1990
#

#	fm works on the following systems:
#	Xenix 2.3.2 and AT&T Unix 3.2.2.
#	SunOS 4.0.3, SPARCstation-1 (others are probably trivial)
#	IBM XT, MS-DOS 3.1, Microsoft C 5.0
#	DECstation-2100/3100, Ultrix
#	Sony News workstation, NEWS-OS (BSD 4.2)
#
#	other systems have not been tried....
#
#	select the compiler/linker options for your system
#	If you are using a unix-type of system, make fm with:
#
#		make unix
#
#---------------------------------------------
# AT&T Unix 3.2.2 - terminfo curses
# LDFLAGS= -lcurses
# CCFLAGS= -O -DSYSV_CURSES

#---------------------------------------------
# Xenix setup:  depending on how the development package was installed,
#               you may choose to include or remove -DM_TERMINFO
# 		and -DM_TERMCAP from the following....

#---------------------------------------------
# Xenix 2.3.2 - terminfo curses
# LDFLAGS = -ltinfo
# CCFLAGS = -O -DSYSV_CURSES -DM_TERMINFO

#---------------------------------------------
# SunOs or Xenix 2.3.2 - termcap curses
O = .o
E = 
LDFLAGS = -lcurses -ltermcap
CCFLAGS = -O

#CCFLAGS = -g

#---------------------------------------------
# MS-DOS with Microsoft C 5.0 and pc-curses, available from uunet
# Note 1: you will have to change the link step below as well as
#         the flags in this section.
# Note 2: Huge model is definitely overkill, but I have no patience
#         with 8086 memory models...
#CCFLAGS	= /AH /FPi /J /W3 /I. /Ox /Gs
##CCFLAGS	= /AH /FPi /J /W3 /I. /Zi
#LD = link
## Make sure the memory model of pc-curses agrees with the one chosen above!
#LDFLAGS = lcurses.lib/stack:50000
##LDFLAGS = /CO /stack:50000

#---------------------------------------------
# Other unix systems:  the following may/not work for other unix systems
#		       using termcap curses:
# LDFLAGS = -lcurses
# CCFLAGS = -O

SOURCES = Readme Makefile fm.1 fm.c patchlevel.h vms.hc

OBJECTS=fm$(O)

all:	fm$(E)

fm$(O):	fm.c

fm$(E):	fm$(O)
# for Unix:
	cc fm$(O) -o fm$(E) $(LDFLAGS)
# for DOS
#	link fm$(O),fm$(E),fm/map,$(LDFLAGS)

unix:
	$(CC) $(CCFLAGS) fm.c $(LDFLAGS) -o fm

lint:
	lint $(LINTFLAGS) fm.c $(LIBS) >fm.lint

shar:
	makekit -oMANIFEST -nfm -s64k $(SOURCES)

tar:
	tar -cvAf fm.tar $(SOURCES)
