###############################################################################
#
#	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) $*.c

.c.oo:
	sc $(CFLAGS) $(GST) $(OPTIMIZE) opttime objname=$*.oo $*.c

.asm.o:
	asm -d $*.asm

CPU		= ANY
#CPU		= 68030

OPTIMIZE	= optimize

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

C_UTILITY	= utillib
L_UTILITY	= define __CXM33=__UCXM33 define __CXD33=__UCXD33 \
		  define __CXM22=__UCXM22 define __CXD22=__UCXD22

DEBUG		= debug=line

GST		= gstimm gst=term.gst

CFLAGS		= mccons streq strmerge nostkchk idlen=65 nover nooptinlocal \
		  ignore=306 cpu=$(CPU) define=CPU_$(CPU) $(C_UTILITY) $(DEBUG)

LIBS		= lib:sc.lib lib:amiga.lib lib:debug.lib

OBJS		= termTag.o ASCIIPanel.o CapturePanel.o CaptureParser.oo Chat.o \
		  ClipPanel.o Colour.oo CommandPanel.o CopyPanel.o CursorPanel.o \
		  CustomRequest.o DatePanel.o DayPanel.o EmulationPanel.o FastMacroPanel.o \
		  FixPath.o HotkeyPanel.o ImportPanel.o LibPanel.o LibPanelPlus.o \
		  MacroPanel.o Matrix.o MiscPanel.o ModemPanel.o \
		  PathPanel.o PatternPanel.o PhonePanel.o PhonePanelPlus.o PhonePanelUI.o \
		  PrintPanel.o QuickSort.o RatePanel.o ScreenPanel.o SerialIO.oo \
		  SerialPanel.o SoundPanel.o SpeechPanel.o StackCall.o Start.o \
		  TerminalPanel.o TimePanel.o TransferPanel.o TranslationPanel.o TrapPanel.o \
		  UploadPanel.o termAbout.o 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.o \
		  termFileBuffer.oo termHotkeys.o termIdentify.o termInfoWindow.o termInit.o \
		  termLists.oo termLocale.o termMain.o termMarker.o termMem.o \
		  termMemory.oo termMsgQueue.oo termOldConfig.o termPacket.o termPhone.o \
		  termPickFile.o termPickScreen.o termPrint.o termRaster.oo termRemember.oo \
		  termResponse.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 termVerify.o termXEM.oo termXPR.oo

all:		term.gst term

termTag.o:	termTag.asm term_rev.i
		asm -d -dCPU_$(CPU) -dCPU='$(CPU)' termTag.asm

term:		$(OBJS)
		slink with t:term.with <<!(t:term.with)
			from
			$(OBJS)
			to
			$@
			lib
			$(LIBS)
			sc sd nd noicons maxhunk 100000
			$(L_UTILITY)
		<

term.gst:	PreInclude.c PreInclude.h termStrings.h OwnDevUnit.h xproto.h xem.h Rendezvous.h $(INCLUDEFILES)
		gst 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) opttime 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
