TOP_DIR = ../

## includes

include $(TOP_DIR)/config.mk


## target

TARGET = aqua-demo


## objects

OBJ = main.o callback.o camera.o draw.o draw_surface.o fps.o help.o \
      help_phillips.o options_local.o scene.o scene_phill_ugauss.o sun.o \
      transform.o


## LDFLAGS

LOCAL_LIB = $(LIBAQUA) \
            $(LIB_DIR)/exceptions.o $(LIB_DIR)/get_file_name.o \
            $(LIB_DIR)/getopt.o $(LIB_DIR)/options.o \
            $(LIB_DIR)/options_getopt.o $(LIB_DIR)/options_libaqua.o 

LDFLAGS  += $(LOCAL_LIB) $(X_LDFLAGS)

## main rules

all: $(TARGET)


$(TARGET): $(OBJ) $(LOCAL_LIB)
	$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJ)


## objects rules

callback.o: callback.cpp callback.h camera.h draw.h fps.h help_phillips.h \
  help.h scene_phill_ugauss.h scene.h sun.h transform.h config.h \
  ../include/constant.h
camera.o: camera.cpp camera.h ../include/constant.h
draw.o: draw.cpp draw.h draw_surface.h scene.h sun.h
draw_surface.o: draw_surface.cpp draw_surface.h ../include/memory.h
fps.o: fps.cpp fps.h
help.o: help.cpp help.h config.h camera.h ../include/constant.h
help_phillips.o: help_phillips.cpp help_phillips.h help.h config.h \
  camera.h ../include/constant.h
main.o: main.cpp callback.h options_local.h ../lib/options.h \
  ../lib/options_libaqua.h ../lib/options_getopt.h ../lib/getopt.h \
  ../lib/exceptions.h
options_local.o: options_local.cpp options_local.h ../lib/options.h \
  ../lib/options_libaqua.h ../lib/options_getopt.h ../lib/getopt.h \
  ../include/version.h
scene.o: scene.cpp scene.h config.h camera.h ../include/constant.h \
  ../src/aqua_surface.h
scene_phill_ugauss.o: scene_phill_ugauss.cpp scene_phill_ugauss.h scene.h \
  config.h camera.h ../include/constant.h \
  ../src/aqua_surface_phill_ugauss.h ../src/aqua_surface_phillips.h \
  ../src/aqua_surface.h
sun.o: sun.cpp sun.h ../include/constant.h
transform.o: transform.cpp transform.h camera.h scene.h sun.h


## other rules

clean:
	$(RM) $(OBJ) $(TARGET)


.PHONY: all clean
