# Makefile for util: Amiga Aztec C version
# Copyright 1989 Carnegie Mellon University
# Last modified date: 

CAMDDIR = :camd/include
CAMDLIB = :camd/lib/camd-aztec
CMTDIR = //lib
CMTLIB = $(CMTDIR)/cmt

# Definition of Compiler, Linker, and Flags
CC     = cc
CFLAGS = -bs -I$(CAMDDIR) -I$(CMTDIR) 
LN     = ln
LFLAGS = -g -l$(CMTLIB) -lm -lc
#special flags for packer: don't use cmtlib
LFLAGS2 = -g -lm -lc

# EVERYTHING is everything this makefile knows how to make
EVERYTHING = step tuning packer unpacker repitch 

# CURRENT is the file we want to make now.
CURRENT = $(EVERYTHING) aamakefile

CLEANOBJ = #?.o #?.dbg
RECOMP = ste? tun?ng pack?r unpack?r adaset?p repit?h ; wildcard avoids error return

#-------------------------------------------------------------------------

current : $(CURRENT)
	echo "made $(CURRENT)"

everything : $(EVERYTHING)
	echo "made $(EVERYTHING)"

packer : packer.o convert.o
	$(LN) packer convert.o $(LFLAGS2)

unpacker : unpacker.o convert.o
	$(LN) unpacker.o convert.o $(LFLAGS2)

#WATCH OUT HERE! Aztec C has a bug where an enum gets passed
#	as an int (which is 32 bits), but received as a 16-bit word!
#	The -pe switch says compile enums into short representation.
#	This works for Aztec C v5.0a.
step.o : step.c
	$(CC) $(CFLAGS) -pe -o step.o step.c

step : step.o
	$(LN) step.o $(LFLAGS2)

tuning : tuning.o $(CMTLIB).lib
	$(LN) tuning.o $(LFLAGS) 

repitch : repitch.o
	$(LN) repitch.o $(LFLAGS2)

aamakefile : makefile
	copy makefile aamakefile

# clean objects for library
clean :
	delete $(CLEANOBJ)

purge : clean
	delete $(RECOMP)
