CC = cc
AS = objasm
CFLAGS = -c -strict -ITCPIPLibs:,C: -fa -apcs 3/32 -throwback -depend !Depend\
	 -Ospace -Wp -DSTDC_HEADERS -DHAVE_LIMITS_H\
	 $(FORTIFY)
ASFLAGS = -apcs 3/32 -throwback -depend !Depend -PD "S SETS \"\""

LINK = link
LINKFLAGS = $(LDEBUG)

WIPE = wipe
WIPEFLAGS = ~CFR~V

OBJS =	o.configure o.digest o.fetch o.md5 o.globals o.main o.save o.util \
	o.wimp o.wimpmenu o.wimpticker o.wimputil o.veneers o.fortify \
	o.ft-rdf o.xml

LIBS =	C:o.stubs TCPIPLibs:o.unixlib-32 TCPIPLibs:o.socklib-32 TCPIPLibs:o.inetlib-32

all:	!Ticker.!RunImage !Ticker.setsprites o

o:
	cdir o

dist:	ticker/zip ticker.src

ticker/zip:		!Ticker.!RunImage
	remove ticker/zip
	zip -9r ticker/zip !Ticker -x *.CVS *.*.CVS *.CVS.* *.*.CVS.* *./cvsignore *.!RunDebug *.stderr

ticker/src:		Makefile Makefile26 c.* h.* s.*
	remove ticker/src
	zip -9r ticker/src Makefile Makefile26 c h s -x *.CVS *./cvsignore

!Ticker.!RunImage:	$(OBJS)
	$(LINK) -o $@ $(LINKFLAGS) $(OBJS) $(LIBS)

!Ticker.setsprites:	o.setsprites
	$(LINK) -bin -o $@ o.setsprites
	SetType !Ticker.setsprites Utility

o.setsprites:		s.setsprites
	$(AS) -abs -throwback -o $@ s.setsprites

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

clean:
	-$(WIPE) o.* $(WIPEFLAGS)

.SUFFIXES: .c .s .o

.c.o:
	$(CC) $(CFLAGS) $(DEBUG) -o $@ $<

.s.o:
	$(AS) $(ASFLAGS) -o $@ $<

# Dynamic dependencies:
o.configure:	c.configure
o.configure:	C:h.swis
o.configure:	C:h.kernel
o.configure:	h.globals
o.configure:	C:h.swis
o.configure:	C:h.kernel
o.configure:	h.fetchers
o.configure:	h.fetch
o.configure:	h.wimp
o.configure:	h.wimpmenu
o.configure:	h.wimp
o.configure:	h.util
o.globals:	c.globals
o.globals:	h.globals
o.globals:	C:h.swis
o.globals:	C:h.kernel
o.globals:	C:h.kernel
o.globals:	h.fetchers
o.globals:	h.fetch
o.globals:	h.wimp
o.save:	c.save
o.save:	C:h.swis
o.save:	C:h.kernel
o.save:	h.globals
o.save:	C:h.swis
o.save:	C:h.kernel
o.save:	h.configure
o.save:	h.wimpmenu
o.save:	h.wimp
o.save:	h.fetchers
o.save:	h.fetch
o.save:	h.wimp
o.wimpmenu:	c.wimpmenu
o.wimpmenu:	h.globals
o.wimpmenu:	C:h.swis
o.wimpmenu:	C:h.kernel
o.wimpmenu:	C:h.kernel
o.wimpmenu:	h.configure
o.wimpmenu:	h.wimpmenu
o.wimpmenu:	h.wimp
o.wimpmenu:	h.fetch
o.wimpmenu:	h.wimp
o.wimpmenu:	h.wimpmenu
o.wimpmenu:	h.wimpticker
o.wimpticker:	c.wimpticker
o.wimpticker:	C:h.swis
o.wimpticker:	C:h.kernel
o.wimpticker:	h.globals
o.wimpticker:	C:h.swis
o.wimpticker:	C:h.kernel
o.wimpticker:	h.fetch
o.wimpticker:	h.wimp
o.wimpticker:	h.wimpmenu
o.wimpticker:	h.wimp
o.wimpticker:	h.wimpticker
o.ft-rdf:	c.ft-rdf
o.ft-rdf:	C:h.swis
o.ft-rdf:	C:h.kernel
o.ft-rdf:	h.globals
o.ft-rdf:	C:h.swis
o.ft-rdf:	C:h.kernel
o.ft-rdf:	h.digest
o.ft-rdf:	h.fetch
o.ft-rdf:	h.util
o.ft-rdf:	h.wimp
o.ft-rdf:	h.xml
