#
# File:		makefile.unx
# Author:	Julian Smart
# Created:	1998
# Updated:	
# Copyright:	(c) 1998 Julian Smart
#
# "%W% %G%"
#
# Makefile for cube example (UNIX).

OPENGL_LIBS=-lGL -lGLU -lglut
#OPENGL_LIBS=-lMesaGL -lMesaGLU

# wx-config generates needed flags:
CC = $(shell wx-config --cc)
CCFLAGS = $(shell wx-config --cflags)
CXX = $(shell wx-config --cxx)
CXXFLAGS = $(shell wx-config --cxxflags)
LIBFLAGS = $(shell wx-config --libs)
#INCLUDE=/home/mike/private/programming/jama/
INCLUDE=./jama/

# probably will have to change wx_x11univ_gl-2.6 to some other library:

test: test.o trackball.o 3dsloader.o mesh.o math3d.o
	#$(CXX) -I$(INCLUDE) -o test \
	#	trackball.o 3dsloader.o mesh.o test.o math3d.o \
	#	`wx-config --libs` -lm $(OPENGL_LIBS)
	$(CXX) `wx-config --libs core,base,gl` trackball.o 3dsloader.o mesh.o test.o math3d.o -lm -lglut -o test

test.o: test.cpp
	$(CXX) -o test.o $(CXXFLAGS) -I$(INCLUDE) -c test.cpp

trackball.o: trackball.c
	$(CC) -o trackball.o $(CCFLAGS) -c trackball.c

3dsloader.o: 3dsloader.cpp
	$(CXX) -I$(INCLUDE) -o 3dsloader.o -c 3dsloader.cpp

mesh.o: mesh.cpp
	$(CXX) -o mesh.o $(CCFLAGS) -I$(INCLUDE) -c mesh.cpp

math3d.o: math3d.cpp
	$(CXX) -o math3d.o -c math3d.cpp


clean: 
	rm -f *.o test
