# Makefile for cornucopia (crn)

CAMDDIR = :camd/include
CAMDLIB = :camd/lib/camd.lib
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

# EVERYTHING is everything this makefile knows how to make
EVERYTHING = crn

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

CRNOBJ  = crn.o mapper.o mapread.o scan.o crnhandlers.o
CLEANOBJ = #?.o
RECOMP = cr? ; wildcard to avoid error return

MOXCOBJ =  $(CMTDIR)/moxc.o $(CMTDIR)/moxcmain.o 

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

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

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

crn : $(CRNOBJ) $(MOXCOBJ) $(CMTLIB).lib
	$(LN) $(CRNOBJ) $(MOXCOBJ) $(LFLAGS) 

aamakefile : makefile
	copy makefile aamakefile

clean :
	delete $(CLEANOBJ)
	delete #?.dbg

purge : clean
	delete $(RECOMP)
