# File: Makefile
#
#	Cube demo makefile
#
#	Written by Toshio Fukui. (01/09/2002-09/07/2002)
#

include MCONFIG

DEFINES	= $(GDEFINES)
CFLAGS	= $(GCFLAGS) $(DEFINES)
INCDIRS = $(GINCDIRS)
LFLAGS  = $(GLFLAGS)
LIBS    = $(GLIBS)

TARGET	= cubedemo
OBJS	= init.o main.o cube.o \
 draw.o font.o geometry.o matrix.o prim3d.o tex.o vpu1.o \
 fileio.o input.o memory.o debug.o

all:	$(TARGET)

run:	all
	$(TARGET)

clean:
	$(RM) -rf tmp .depend
	$(RM) *~ *.bak *.BAK \#* *.o *.tmp *.TMP
	$(RM) $(TARGET)

depend:
	$(DEPEND) -f- $(DEFINES) $(INCDIRS) $(OBJS:.o=.c) >.depend

$(TARGET) : $(OBJS)
	$(CC) $(LFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

.c.o	:
	$(CC) -c $(CFLAGS) $(INCDIRS) $<

# include dependencies
ifneq ($(wildcard .depend),)
include .depend
endif
