#
# The name of the tool.
#
TOOL = cccc

#
# The source files that you need to build the tool.
#
MYSRCS = cccc.c

MYHDRS = myheader.h

#
# You might want to tinker with the compiler flags and libraries.
#
# -3.0	- Compile for a 3.0 system (optional)
# -mc	- Small code model
# -md	- Small data model
#
CFLAGS = -3.0 -mc -md

#
# Required libraries
#
# amiga30s.lib	- The small code version of the Amiga library
# cs.lib	- The small code version of the C library
# ms.lib	- The small code version of the maths library
#
LIBS =	amiga30s.lib cs.lib ms.lib

#
# You shouldn't have to touch anything below here.
#
# (FYI: (It's important that toolstart.c gets listed first... toolstart.o
#  has to be the first thing mentioned when the tool is linked
#  together.)
#
PTOOL = $(TOOL).ptool
README = $(TOOL).readme
ARCHIVE = $(TOOL).lha

SRCS = toolstart.c $(MYSRCS)
OBJS = $(SRCS:*.c:*.o)

all: $(PTOOL)

$(PTOOL):	$(OBJS)
	dlink $(OBJS) $(LIBS) -o $(PTOOL)

$(OBJS):	$(SRCS)
	dcc $(CFLAGS) -c %(right) -o %(left)

# I use emacs, so I tend to have a lot of backup files ending in ``!''
# lying around. 
clean:
	delete $(OBJS) *!

clobber:	clean
	delete $(PTOOL) $(ARCHIVE)

distribution:	$(ARCHIVE)

$(ARCHIVE):	clobber $(PTOOL) clean
	lha a $(ARCHIVE) dmakefile $(PTOOL) $(MYHDRS) $(MYSRCS) $(README)



