PROGRAM = ivv#
OBJS = main.o IncompleteVRMLViewer.o InfoDialog.o

FLEX = @FLEX@
BISON = @BISON@
PKG_CONFIG = @PKG_CONFIG@

CFLAGS = -Wall -O2 -IReader -IReader/VRMLReader -ISceneGraph -IToolkit -IUtility $(FLAGS) `$(PKG_CONFIG) --cflags gtk+-2.0 gtkglext-1.0`
LDFLAGS = -L. -LReader -lReader -LToolkit -lToolkit -LSceneGraph -lSceneGraph -LUtility -lUtility `$(PKG_CONFIG) --libs gtk+-2.0 gtkglext-1.0`

CC = g++
LD = g++
RM = /bin/rm -f

all: $(OBJS) Reader SceneGraph Toolkit Utility
	$(LD) $(OBJS) -o $(PROGRAM) $(LDFLAGS)

%.o: %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

Reader:
	cd Reader && make BISON=$(BISON) FLEX=$(FLEX)

SceneGraph:
	cd SceneGraph && make

Toolkit:
	cd Toolkit && make PKG_CONFIG=$(PKG_CONFIG)

Utility:
	cd Utility && make

clean:
	cd Reader && make clean
	cd SceneGraph && make clean
	cd Toolkit && make clean
	cd Utility && make clean
	$(RM) *~ *.o $(PROGRAM)

.PHONY: Reader SceneGraph Toolkit Utility

