SRC=	twine.c
OBJ=	twine.o

OTHER= Makefile twine.1
FILES= $(OTHER) $(SRC)

# Set these commands to appropriate values for your system

# Directory where non-TWINE executables are kept
SISBIN=/usr/new/sisal/Osc/bin
# Max allowable files per compile
MAXFILES=100
# Longest name or path
NAMELEN=100
# Length of sub-compiler command
COMMANDSIZE=1000
# Where the TWINE files are installed
TWINEDIR=$(REL)
# Pathname to SISAL compiler
SISAL=$(SISBIN)/osc -IF1
# Pathname to the  Iter loop converter
SISALFIX=$(TWINEDIR)/bin/fixloop
# Application to sort if1 files by source line
LINEORDER=$(TWINEDIR)/bin/lineorder
# Pointer to the IF1 converter
YIFT=$(TWINEDIR)/bin/yift
# The C compiler
CC=cc
# The loader
LD=cc
# The name of the executable TWINE produces
EXE=t.out
# Default entry point
ENTRY=main

FLAGS=	-DMAXFILES="($(MAXFILES))" \
	-DNAMELEN="($(NAMELEN))" \
	-DCOMMANDSIZE="($(COMMANDSIZE))" \
	-DDEFAULT_TWINEDIR='"$(TWINEDIR)"' \
	-DDEFAULT_SISAL='"$(SISAL)"' \
	-DDEFAULT_SISALFIX='"$(SISALFIX)"' \
	-DDEFAULT_IF1ORDER='"$(LINEORDER)"' \
	-DDEFAULT_YIFT='"$(YIFT)"' \
	-DDEFAULT_CC='"$(CC)"' \
	-DDEFAULT_LD='"$(LD)"' \
	-DDEFAULT_EXE='"$(EXE)"' \
	-DDEFAULT_ENTRY='"$(ENTRY)"' \
	-DDEFAULT_MACHINE='"$(MACHINE)"' \
	-DDEFAULT_OS='"$(OS)"'

OTHERFLAGS= -D$(MACHINE) -D$(OS)

CFLAGS= $(OPTFLAGS) $(OTHERFLAGS) $(FLAGS)

twine: twine.o
	$(CC) -o twine twine.o

twine.o: twine.c
	$(CC) $(CFLAGS) -c twine.c

install: twine
	@if ( test "$(REL)" != "" ) then \
	cp twine $(REL)/bin; \
	cp twine.1 $(REL)/man; \
	chmod 777 $(REL)/bin/twine ; \
	else echo No release directory; fi
#------------------------------------------------------------
lint:
	lint $(SRC) $(FLAGS) > lint.out

clean:
	-@ls $(FILES) > KeepList
	-@/bin/rm `ls | fgrep -v -x -f KeepList`
#