INC_PATH=$(ROOT_PATH)/src
LIB_PATH=$(ROOT_PATH)/ext
BIN_PATH=$(ROOT_PATH)/bin

#compiler
CC = g++
#linker
LD = g++
#static libs
STATIC_LIBS = $(LIB_PATH)/glew/lib/libGLEW.a

CFLAGS = -pipe -Wall -I$(INC_PATH) -I$(LIB_PATH)/glew/include/
LDFLAGS = -lm -lGL -lGLU -lglut

OBJS = ${SRCS:.cpp=.o}
COMMONOBJ = `find $(ROOT_PATH)/src -name \*.o`

################################
# functions for all makefiles
################################

all: subdirs objects

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

objects: $(OBJS)

dep:
	@for i in $(SUBDIRS); do\
        cd $$i && $(MAKE) dep; \
		cd ..; \
    done
	makedepend -f- -- $(CFLAGS) -- $(SRCS) 2>/dev/null > .depend

subdirs:
	@for i in $(SUBDIRS); do\
        cd $$i && $(MAKE); \
		cd ..; \
    done

clean: localclean
	rm -f *.o
	@for i in $(SUBDIRS); do\
        cd $$i && $(MAKE) clean; \
		cd ..; \
    done

depclean: 
	rm -f .depend
	@for i in $(SUBDIRS); do\
        cd $$i && $(MAKE) clean; \
		cd ..; \
    done


