###############################################################################
#
#	SMakefile
#
#	Makefile for the `SMake' utility required to build `term'
#
#	Copyright © 1990-1995 by Olaf `Olsen' Barthel
#		All Rights Reserved
#
###############################################################################

.c.o:
	SC $(CFLAGS) $(GST) $(OPTIONS) $(DEBUG) OBJNAME=$*.o $*.c

.c.oo:
	SC $(CFLAGS) $(GST) $(OPTIONS) $(DEBUG) $(OPTIMIZE) OBJNAME=$*.oo $*.c

.asm.o:
	ASM -D $*.asm

#CPU		= ANY
CPU		= 68030

OPTIMIZE	= OPTIMIZE OPTTIME NOOPTINLOCAL

INCLUDEFLAGS	= DEFINE=INCLUDEALL
INCLUDEFILES	= gtlayout.h termGlobal.h termData.h termProtos.h \
		  termErrors.h termARexxAttributes.h termARexxGlobal.h

#OPTIONS		= CPU=$(CPU) UTILLIB
OPTIONS		= CPU=$(CPU)
DEBUG		= DEBUG=LINE

GST		= GSTIMM GST=term.gst

CFLAGS		= MCCONS STREQ STRMERGE NOSTKCHK IDLEN=65 NOVER \
		  IGNORE=306 DEFINE=DATAFEED
#LFLAGS		= DEFINE __CXM33=__UCXM33 DEFINE __CXD33=__UCXD33 \
#		  DEFINE __CXM22=__UCXM22 DEFINE __CXD22=__UCXD22 \
#		  ND SC SD NOICONS MAXHUNK 100000

LFLAGS		= ND SC SD NOICONS MAXHUNK 100000

LIBS		= LIB:sc.lib LIB:amiga.lib

OBJS		= termTag.o ASCIIPanel.o CapturePanel.o CaptureParser.oo \
		  Chat.o ClipPanel.o CommandPanel.o CopyPanel.o Colour.oo \
		  CursorPanel.o DatePanel.o DayPanel.o EmulationPanel.o \
		  FastMacroPanel.o HotkeyPanel.o ImportPanel.o LibPanel.o \
		  MacroPanel.o MiscPanel.o ModemPanel.o PasswordUserPanel.o \
		  PathPanel.o PatternPanel.o SerialIO.oo PhonePanel.o \
		  PrintPanel.o QuickSort.o RatePanel.o ScreenPanel.o \
		  SerialPanel.o SoundPanel.o SpeechPanel.o StackCall.o \
		  Start.o termAbout.oo termAmigaGuide.o termARexx.oo \
		  termARexxAttributes.oo termARexxCommands.oo termARexxData.o termASCIITransfer.oo \
		  termAux.o termBeep.o termBoxes.o termBuffer.oo \
		  termCall.o termCapture.oo termClip.oo termConfig.o \
		  termConsole.oo termCRC.o termCrypt.oo termData.o \
		  termDial.o termEmulation.oo termEmulationProcess.oo termFastMacros.o \
		  termFastMacroWindow.oo termFileBuffer.oo termHotkeys.o termIdentify.o \
		  TerminalPanel.o termInfoWindow.o termInit.o termLists.oo \
		  termLocale.o termMain.o termMarker.o termMemory.oo \
		  termMsgQueue.oo termOldConfig.o termPacket.o \
		  termPhone.o termPickFile.o termPickScreen.o termPrint.o \
		  termRaster.oo termRemember.oo termResponse.oo termReviewBuffer.oo \
		  termSaveWindow.o termScale.oo termScroll.oo termSendText.oo \
		  termSerial.oo termSound.oo termSpeech.o termStatusDisplay.o \
		  termStrings.o termTextBuffer.oo termTimeDate.o termTransfer.o \
		  termTranslate.oo termTraps.o termUploadQueue.o termXEM.oo \
		  termXPR.oo TimePanel.o TransferPanel.o TranslationPanel.o \
		  TrapPanel.o UploadPanel.o LibPanelPlus.o termVerify.o \
		  FixPath.o CustomRequest.o

all:		term.gst term

termTag.o:	termTag.asm term_rev.i
		ASM -DCPU_$(CPU) -DCPU='$(CPU)' termTag.asm

term:		$(OBJS)
		SLINK WITH T:term.WITH <<!(T:term.WITH)
			FROM
			$(OBJS)
			TO
			$@
			LIB
			$(LIBS)
			$(LFLAGS)
		<

term.gst:	PreInclude.c PreInclude.h termStrings.h OwnDevUnit.h xproto.h xem.h Rendezvous.h $(INCLUDEFILES)
		GST >NIL: UNLOAD $@
		SC NOOBJNAME DEFINE=CATCOMP_NUMBERS IDLEN=65 $(INCLUDEFLAGS) MAKEGST=$@ PreInclude.c
		GST $@

termStrings.o:	termStrings.c termStrings.h
		SC $(CFLAGS) DATA=FAR termStrings.c

Start.o:	Start.c
		SC $(CFLAGS) $(OPTIMIZE) $(DEBUG) DEFINE=_M$(CPU) Start.c

termARexxCommands.oo:	termARexxCommands.c termARexxGlobal.h termARexxAttributes.h
termARexx.o:		termARexx.c termARexxGlobal.h termARexxAttributes.h
termARexxData.o:	termARexxData.c termARexxGlobal.h termARexxAttributes.h
termARexxAttributes.oo:	termARexxAttributes.c termARexxGlobal.h termARexxAttributes.h
