#
# Makefile to compile the CadMac QuickDraw module.
#

MAIN_DIR =	../..
INCLUDE_DIR =	../$(MAIN_DIR)/include
INCLUDES =	-I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/mac
MACLIB_DIR =	..

LIBVERSION =	mac
MACLIB =	lib$(LIBVERSION).a
LIB =		$(MACLIB_DIR)/$(MACLIB)
OBJDIR =	OBJ.$(LIBVERSION)

# Defaults for use when making from local directory (good only for libmac.a)
# (Overriden if either of these is passed as a parameter to this make)
GLOBFLAGS =	-DAFWS
OPT = 		-O

CFLAGS =	$(OPT) $(INCLUDES) $(GLOBFLAGS)
FRC =		FRC

TOOL_DIR =	$(MAIN_DIR)/mytools/bin
DEPEND =	-$(TOOL_DIR)/depend


LIB_OBJS = \
		Arc.o		\
		BitMap.o	\
		BitTrans.o	\
		Color.o		\
		Cursor.o	\
		FillPoly.o	\
		GrafPort.o	\
		Misc.o		\
		Oval.o		\
		Pen.o		\
		Picture.o	\
		Point.o		\
		Polygon.o	\
		Rect.o		\
		Region.o	\
		RoundRect.o	\
		Standard.o	\
		StdBits.o	\
		StdShapes.o	\
		StdText.o	\
		Text.o		\
		Util.o

#### Make Rules

mac mac.debug mac.afws mac.afwsdebug mac.multi:		$(FRC)
		make "LIBVERSION=$@" "GLOBFLAGS=$(GLOBFLAGS)" "OPT=$(OPT)" start

libLmac Lmac:		$(FRC)
		make "LIBVERSION=Lmac" "GLOBFLAGS=$(GLOBFLAGS) -4" start

libmacnsc macnsc:	$(FRC)
		make "LIBVERSION=macnsc" "GLOBFLAGS=$(GLOBFLAGS) -fN" start

libLmacnsc Lmacnsc:	$(FRC)
		make "LIBVERSION=Lmacnsc" "GLOBFLAGS=$(GLOBFLAGS) -4 -fN" start

all:		libmac libLmac libmacnsc libLmacnsc

start:
		-rm -f *.o
		-ln -f $(OBJDIR)/*.o .
		-make "GLOBFLAGS=$(GLOBFLAGS)" "LIBVERSION=$(LIBVERSION)" "OPT=$(OPT)" lib
		-rm -f *.o

lib:		$(LIB_OBJS)
		ar rv $(LIB) $(LIB_OBJS)
		@echo "*** QuickDraw files in $(LIB) are now up to date."

$(LIB):		$(LIB_OBJS)
		ar rv $@ $(OBJDIR)/*.o

$(FRC):		;

clean:
		-/bin/rm -f OBJ.*/*.o *.o a.out core

depend:
		$(DEPEND) -M Makefile -S $(INCLUDES) $(LIB_OBJS)

#### Make Directives

.PRECIOUS:	$(LIB)

.c.o:
		$(CC) $(CFLAGS) -c $<
		-rm -f $(OBJDIR)/$*.o
		-ln -f $*.o $(OBJDIR)

.s.o:
		$(CC) $(CFLAGS) -c $<
		-rm -f $(OBJDIR)/$*.o
		-ln -f $*.o $(OBJDIR)

########################################################################
############ DO NOT PUT STUFF BELOW HERE -- IT WILL GO AWAY ############
############ DO NOT DELETE THIS LINE -- MAKE DEPEND USES IT ############

Arc.o:          Arc.c
Arc.o:          ./local.h
Arc.o:          $(INCLUDE_DIR)/mac/global.h
Arc.o:          $(INCLUDE_DIR)/mac/bool.h
Arc.o:          $(INCLUDE_DIR)/mac/MemMgr.h
Arc.o:          $(INCLUDE_DIR)/mac/QuickDraw.h
Arc.o:          $(INCLUDE_DIR)/mac/FontMgr.h
Arc.o:          $(INCLUDE_DIR)/mac/OSIntrface.h
Arc.o:          /usr/include/math.h
#Arc.o:          /usr/include/values.h

BitMap.o:       BitMap.c
BitMap.o:       ./local.h
BitMap.o:       $(INCLUDE_DIR)/mac/global.h
BitMap.o:       $(INCLUDE_DIR)/mac/bool.h
BitMap.o:       $(INCLUDE_DIR)/mac/MemMgr.h
BitMap.o:       $(INCLUDE_DIR)/mac/QuickDraw.h
BitMap.o:       $(INCLUDE_DIR)/mac/FontMgr.h
BitMap.o:       $(INCLUDE_DIR)/mac/OSIntrface.h
BitMap.o:       /usr/include/math.h
#BitMap.o:       /usr/include/values.h

BitTrans.o:     BitTrans.c
BitTrans.o:     ./local.h
BitTrans.o:     $(INCLUDE_DIR)/mac/global.h
BitTrans.o:     $(INCLUDE_DIR)/mac/bool.h
BitTrans.o:     $(INCLUDE_DIR)/mac/MemMgr.h
BitTrans.o:     $(INCLUDE_DIR)/mac/QuickDraw.h
BitTrans.o:     $(INCLUDE_DIR)/mac/FontMgr.h
BitTrans.o:     $(INCLUDE_DIR)/mac/OSIntrface.h
BitTrans.o:     /usr/include/math.h
#BitTrans.o:     /usr/include/values.h

Color.o:        Color.c
Color.o:        ./local.h
Color.o:        $(INCLUDE_DIR)/mac/global.h
Color.o:        $(INCLUDE_DIR)/mac/bool.h
Color.o:        $(INCLUDE_DIR)/mac/MemMgr.h
Color.o:        $(INCLUDE_DIR)/mac/QuickDraw.h
Color.o:        $(INCLUDE_DIR)/mac/FontMgr.h
Color.o:        $(INCLUDE_DIR)/mac/OSIntrface.h
Color.o:        /usr/include/math.h
#Color.o:        /usr/include/values.h

Cursor.o:       Cursor.c
Cursor.o:       ./local.h
Cursor.o:       $(INCLUDE_DIR)/mac/global.h
Cursor.o:       $(INCLUDE_DIR)/mac/bool.h
Cursor.o:       $(INCLUDE_DIR)/mac/MemMgr.h
Cursor.o:       $(INCLUDE_DIR)/mac/QuickDraw.h
Cursor.o:       $(INCLUDE_DIR)/mac/FontMgr.h
Cursor.o:       $(INCLUDE_DIR)/mac/OSIntrface.h
Cursor.o:       /usr/include/math.h
#Cursor.o:       /usr/include/values.h

FillPoly.o:     FillPoly.c
FillPoly.o:     ./local.h
FillPoly.o:     $(INCLUDE_DIR)/mac/global.h
FillPoly.o:     $(INCLUDE_DIR)/mac/bool.h
FillPoly.o:     $(INCLUDE_DIR)/mac/MemMgr.h
FillPoly.o:     $(INCLUDE_DIR)/mac/QuickDraw.h
FillPoly.o:     $(INCLUDE_DIR)/mac/FontMgr.h
FillPoly.o:     $(INCLUDE_DIR)/mac/OSIntrface.h
FillPoly.o:     /usr/include/math.h
#FillPoly.o:     /usr/include/values.h

GrafPort.o:     GrafPort.c
GrafPort.o:     ./local.h
GrafPort.o:     $(INCLUDE_DIR)/mac/global.h
GrafPort.o:     $(INCLUDE_DIR)/mac/bool.h
GrafPort.o:     $(INCLUDE_DIR)/mac/MemMgr.h
GrafPort.o:     $(INCLUDE_DIR)/mac/QuickDraw.h
GrafPort.o:     $(INCLUDE_DIR)/mac/FontMgr.h
GrafPort.o:     $(INCLUDE_DIR)/mac/OSIntrface.h
GrafPort.o:     /usr/include/math.h
#GrafPort.o:     /usr/include/values.h

Misc.o:         Misc.c
Misc.o:         ./local.h
Misc.o:         $(INCLUDE_DIR)/mac/global.h
Misc.o:         $(INCLUDE_DIR)/mac/bool.h
Misc.o:         $(INCLUDE_DIR)/mac/MemMgr.h
Misc.o:         $(INCLUDE_DIR)/mac/QuickDraw.h
Misc.o:         $(INCLUDE_DIR)/mac/FontMgr.h
Misc.o:         $(INCLUDE_DIR)/mac/OSIntrface.h
Misc.o:         /usr/include/math.h
#Misc.o:         /usr/include/values.h

Oval.o:         Oval.c
Oval.o:         ./local.h
Oval.o:         $(INCLUDE_DIR)/mac/global.h
Oval.o:         $(INCLUDE_DIR)/mac/bool.h
Oval.o:         $(INCLUDE_DIR)/mac/MemMgr.h
Oval.o:         $(INCLUDE_DIR)/mac/QuickDraw.h
Oval.o:         $(INCLUDE_DIR)/mac/FontMgr.h
Oval.o:         $(INCLUDE_DIR)/mac/OSIntrface.h
Oval.o:         /usr/include/math.h
#Oval.o:         /usr/include/values.h

Pen.o:          Pen.c
Pen.o:          ./local.h
Pen.o:          $(INCLUDE_DIR)/mac/global.h
Pen.o:          $(INCLUDE_DIR)/mac/bool.h
Pen.o:          $(INCLUDE_DIR)/mac/MemMgr.h
Pen.o:          $(INCLUDE_DIR)/mac/QuickDraw.h
Pen.o:          $(INCLUDE_DIR)/mac/FontMgr.h
Pen.o:          $(INCLUDE_DIR)/mac/OSIntrface.h
Pen.o:          /usr/include/math.h
#Pen.o:          /usr/include/values.h

Picture.o:      Picture.c
Picture.o:      ./local.h
Picture.o:      $(INCLUDE_DIR)/mac/global.h
Picture.o:      $(INCLUDE_DIR)/mac/bool.h
Picture.o:      $(INCLUDE_DIR)/mac/MemMgr.h
Picture.o:      $(INCLUDE_DIR)/mac/QuickDraw.h
Picture.o:      $(INCLUDE_DIR)/mac/FontMgr.h
Picture.o:      $(INCLUDE_DIR)/mac/OSIntrface.h
Picture.o:      /usr/include/math.h
#Picture.o:      /usr/include/values.h
Picture.o:      /usr/include/stdio.h

Point.o:        Point.c
Point.o:        ./local.h
Point.o:        $(INCLUDE_DIR)/mac/global.h
Point.o:        $(INCLUDE_DIR)/mac/bool.h
Point.o:        $(INCLUDE_DIR)/mac/MemMgr.h
Point.o:        $(INCLUDE_DIR)/mac/QuickDraw.h
Point.o:        $(INCLUDE_DIR)/mac/FontMgr.h
Point.o:        $(INCLUDE_DIR)/mac/OSIntrface.h
Point.o:        /usr/include/math.h
#Point.o:        /usr/include/values.h

Polygon.o:      Polygon.c
Polygon.o:      ./local.h
Polygon.o:      $(INCLUDE_DIR)/mac/global.h
Polygon.o:      $(INCLUDE_DIR)/mac/bool.h
Polygon.o:      $(INCLUDE_DIR)/mac/MemMgr.h
Polygon.o:      $(INCLUDE_DIR)/mac/QuickDraw.h
Polygon.o:      $(INCLUDE_DIR)/mac/FontMgr.h
Polygon.o:      $(INCLUDE_DIR)/mac/OSIntrface.h
Polygon.o:      /usr/include/math.h
#Polygon.o:      /usr/include/values.h

Rect.o:         Rect.c
Rect.o:         ./local.h
Rect.o:         $(INCLUDE_DIR)/mac/global.h
Rect.o:         $(INCLUDE_DIR)/mac/bool.h
Rect.o:         $(INCLUDE_DIR)/mac/MemMgr.h
Rect.o:         $(INCLUDE_DIR)/mac/QuickDraw.h
Rect.o:         $(INCLUDE_DIR)/mac/FontMgr.h
Rect.o:         $(INCLUDE_DIR)/mac/OSIntrface.h
Rect.o:         /usr/include/math.h
#Rect.o:         /usr/include/values.h

Region.o:       Region.c
Region.o:       ./local.h
Region.o:       $(INCLUDE_DIR)/mac/global.h
Region.o:       $(INCLUDE_DIR)/mac/bool.h
Region.o:       $(INCLUDE_DIR)/mac/MemMgr.h
Region.o:       $(INCLUDE_DIR)/mac/QuickDraw.h
Region.o:       $(INCLUDE_DIR)/mac/FontMgr.h
Region.o:       $(INCLUDE_DIR)/mac/OSIntrface.h
Region.o:       /usr/include/math.h
#Region.o:       /usr/include/values.h

RoundRect.o:    RoundRect.c
RoundRect.o:    ./local.h
RoundRect.o:    $(INCLUDE_DIR)/mac/global.h
RoundRect.o:    $(INCLUDE_DIR)/mac/bool.h
RoundRect.o:    $(INCLUDE_DIR)/mac/MemMgr.h
RoundRect.o:    $(INCLUDE_DIR)/mac/QuickDraw.h
RoundRect.o:    $(INCLUDE_DIR)/mac/FontMgr.h
RoundRect.o:    $(INCLUDE_DIR)/mac/OSIntrface.h
RoundRect.o:    /usr/include/math.h
#RoundRect.o:    /usr/include/values.h

Standard.o:     Standard.c
Standard.o:     /usr/include/sys/param.h
Standard.o:     /usr/include/sys/types.h
Standard.o:     /usr/include/stdio.h
Standard.o:     ./local.h
Standard.o:     $(INCLUDE_DIR)/mac/global.h
Standard.o:     $(INCLUDE_DIR)/mac/bool.h
Standard.o:     $(INCLUDE_DIR)/mac/MemMgr.h
Standard.o:     $(INCLUDE_DIR)/mac/QuickDraw.h
Standard.o:     $(INCLUDE_DIR)/mac/FontMgr.h
Standard.o:     $(INCLUDE_DIR)/mac/OSIntrface.h
Standard.o:     /usr/include/math.h
#Standard.o:     /usr/include/values.h

StdBits.o:      StdBits.c
StdBits.o:      /usr/include/sys/param.h
StdBits.o:      /usr/include/sys/types.h
StdBits.o:      /usr/include/stdio.h
StdBits.o:      ./local.h
StdBits.o:      $(INCLUDE_DIR)/mac/global.h
StdBits.o:      $(INCLUDE_DIR)/mac/bool.h
StdBits.o:      $(INCLUDE_DIR)/mac/MemMgr.h
StdBits.o:      $(INCLUDE_DIR)/mac/QuickDraw.h
StdBits.o:      $(INCLUDE_DIR)/mac/FontMgr.h
StdBits.o:      $(INCLUDE_DIR)/mac/OSIntrface.h
StdBits.o:      /usr/include/math.h
#StdBits.o:      /usr/include/values.h

StdShapes.o:    StdShapes.c
StdShapes.o:    ./local.h
StdShapes.o:    $(INCLUDE_DIR)/mac/global.h
StdShapes.o:    $(INCLUDE_DIR)/mac/bool.h
StdShapes.o:    $(INCLUDE_DIR)/mac/MemMgr.h
StdShapes.o:    $(INCLUDE_DIR)/mac/QuickDraw.h
StdShapes.o:    $(INCLUDE_DIR)/mac/FontMgr.h
StdShapes.o:    $(INCLUDE_DIR)/mac/OSIntrface.h
StdShapes.o:    /usr/include/math.h
#StdShapes.o:    /usr/include/values.h

StdText.o:      StdText.c
StdText.o:      /usr/include/sys/param.h
StdText.o:      /usr/include/sys/types.h
StdText.o:      /usr/include/sys/ioctl.h
StdText.o:      ./local.h
StdText.o:      $(INCLUDE_DIR)/mac/global.h
StdText.o:      $(INCLUDE_DIR)/mac/bool.h
StdText.o:      $(INCLUDE_DIR)/mac/MemMgr.h
StdText.o:      $(INCLUDE_DIR)/mac/QuickDraw.h
StdText.o:      $(INCLUDE_DIR)/mac/FontMgr.h
StdText.o:      $(INCLUDE_DIR)/mac/OSIntrface.h
StdText.o:      /usr/include/math.h
#StdText.o:      /usr/include/values.h

Text.o:         Text.c
Text.o:         ./local.h
Text.o:         $(INCLUDE_DIR)/mac/global.h
Text.o:         $(INCLUDE_DIR)/mac/bool.h
Text.o:         $(INCLUDE_DIR)/mac/MemMgr.h
Text.o:         $(INCLUDE_DIR)/mac/QuickDraw.h
Text.o:         $(INCLUDE_DIR)/mac/FontMgr.h
Text.o:         $(INCLUDE_DIR)/mac/OSIntrface.h
Text.o:         /usr/include/math.h
#Text.o:         /usr/include/values.h

Util.o:         Util.c
Util.o:         ./local.h
Util.o:         $(INCLUDE_DIR)/mac/global.h
Util.o:         $(INCLUDE_DIR)/mac/bool.h
Util.o:         $(INCLUDE_DIR)/mac/MemMgr.h
Util.o:         $(INCLUDE_DIR)/mac/QuickDraw.h
Util.o:         $(INCLUDE_DIR)/mac/FontMgr.h
Util.o:         $(INCLUDE_DIR)/mac/OSIntrface.h
Util.o:         /usr/include/math.h
#Util.o:         /usr/include/values.h
