#
#  makefile for hp4l.cpx
#

CC = gcc.ttp
ZOO = f:/archiver/zoo/zoo.ttp


# -mshort and -fcall-used-d2 are mandatory.
CFLAGS = -mshort -fcall-used-d2 -Wall -O2

# -DDEBUG_INFO
DEFS =

LIBS = -lgnu16 -lgem16


hp4l.cpx: hp4l.cp hp4llink.tos
	hp4llink.tos
#	cp hp4l.cpx c:/cpx/hp4l.cpx

hp4llink.tos: hp4llink.c xcontrol.h
	$(CC) -o hp4llink.tos hp4llink.c $(CFLAGS)

hp4l.cp: start.o hp4l.o
	$(CC) -o hp4l.cp start.o hp4l.o -nostdlib -s $(CFLAGS) $(LIBS)

start.o: start.s
	$(CC) -c -o start.o start.s $(CFLAGS) $(DEFS)

hp4l.o: hp4l.c hp4l.h hp4l.rsh xcontrol.h
	$(CC) -c -o hp4l.o hp4l.c $(CFLAGS) $(DEFS)



ARCHIVE = hp4l.cpx hp4l.c hp4l.h hp4l.rsc hp4l.rsh hp4l.dfn \
	start.s hp4llink.c xcontrol.h makefile hp4l.txt copying

archive:
	$(ZOO) a hp4lcpx.zoo $(ARCHIVE)
