# MUST use MiNT libs...
#
GNUINC=/mint/include
GNULIB=/mint/lib

# Extensions by Warwick Allison (warwick@cs.uq.oz.au)
#
#   WWA_EXT_TOSRUN
#        Extend TOSRUN protocol...
#
#        WWA_RUN_TOSWIN
#             run TOSWIN if no TOSRUN pipe found.
#
#        WWA_UNIX_RUN
#             to allow / (or \) as separator in program name.
#
#        WWA_GEM_RUN
#             to run (single-tasked) GEM programs.
#
#        WWA_WIN_RUN
#             to allow window pos/size specification.
#
#        WWA_FONT_RUN
#             to allow window font specification.
#
#   WWA_X_SELECT
#        Use X Window System style text selection:
#           - Left-drag to select area
#           - Left-click to expand selection (char, word, line, none, etc)
#           - Right-click to paste
#        TODO: only have current selection highlighted.
#        TODO: allows run-time config of "word" character classes.
#
#   WWA_AUTO_RAISE
#        Windows are TOPPED when auto-focussed
#
#   WWA_INITIAL_REDRAW
#        Redraw done at startup (to get rid of MiNT/XFS TTY messages)
#
#   WWA_TRUECOLOUR
#        Do not use zero-filling of images for colour-zero-filling.
#        (bitmap data $000000 == black in truecolour)
#
WWA=\
	-DWWA_EXT_TOSRUN \
		-DWWA_RUN_TOSWIN -DWWA_UNIX_RUN -DWWA_GEM_RUN -DWWA_WIN_RUN -DWWA_FONT_RUN \
	-DWWA_AUTO_RAISE -DWWA_INITIAL_REDRAW -DWWA_X_SELECT -DWWA_TRUECOLOUR

# Version 1.2 of these extensions
WWAEXTV=12

MODEL= -mshort
LIBS= -lgem16
CFLAGS=	$(MODEL) -G -O2 -Wall -fomit-frame-pointer $(WWA)


XGEM1= event.o window.o textwin.o menu.o winmenu.o objwin.o
XGEM= $(XGEM1) popup.o

TOSWIN= toswin.o vt52.o util.o iconify.o scrap.o filbuf.o config.o winops.o \
	font.o environ.o gadgets.o

# 'setfast' is a program that sets the TT-RAM and fastload bits
# if you don't have such a program, just delete the
# 'setfast toswin_w.prg' line

all: toswin_w.prg runtos.prg

toswin_w.prg: $(TOSWIN) $(XGEM1)
	gcc $(MODEL) -o toswin_w.prg $(TOSWIN) $(XGEM1) $(LIBS)
	setfast toswin_w.prg
	cp -f toswin_w.prg /f/multitos/toswin

runtos.prg: runtos.o
	gcc $(MODEL) -o runtos.prg runtos.o
	cp -f runtos.prg /f/multitos/toswin

product: toswin_w.prg runtos.prg
	rm -f tw14w$(WWAEXTV)b.zoo tw14w$(WWAEXTV)s.zoo
	zoo ah tw14w$(WWAEXTV)b.zoo toswin_w.prg runtos.prg toswin_w.rsc readme.* copying *.doc *.mnu *.cnf
	zoo ah tw14w$(WWAEXTV)s.zoo *.c *.h *.rsc *.rso readme.* copying *.doc *.mnu makefile
