APPNAME			= testApp_v
DESTDIR			= .

#CC = $(CROSS_COMPILE)gcc
#AR = $(CROSS_COMPILE)ar

TARGET_PATH_LIB = $(ROOTFS)/usr/lib
TARGET_PATH_INCLUDE = $(ROOTFS)/usr/include
COMMON_DIR=../common

BIN_TUT = $(DESTDIR)/$(APPNAME)

CFLAGS += -DDEBUG -D_DEBUG -D_GNU_SOURCE -fPIC -O3 -fno-strict-aliasing -fno-optimize-sibling-calls -Wall -std=c++11 -O0 -fpermissive -g

CFLAGS_TUT = $(CFLAGS) $(CFLAGS_EGL)

CFLAGS_TUT += \
    -DLINUX \
	-DEGL_API_FB \
	-DEGL_API_WL \

CFLAGS_TUT += \
	-I$(TARGET_PATH_INCLUDE) \
	-I$(TARGET_PATH_INCLUDE)/glib-2.0 \
	-I$(TARGET_PATH_INCLUDE)/gstreamer-1.0 \
	-I$(TARGET_PATH_LIB)/gstreamer-1.0/include \
	-I$(TARGET_PATH_LIB)/glib-2.0/include \
	-I$(COMMON_DIR)/inc \
	

OBJECTS_TUT += \
	main.o 
	

DEPS_TUT = -lpthread -lrt -lstdc++ -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lgstreamer-1.0 -lm -ldl -Wl,--library-path=$(TARGET_PATH_LIB),-rpath-link=$(TARGET_PATH_LIB)

$(BIN_TUT) : $(OBJECTS_TUT)
	@echo " LD " $@
	$(QUIET)$(CC) -o $(BIN_TUT) $(OBJECTS_TUT) $(DEPS_TUT)

%.o : %.c
	@echo " CC " $@
	$(QUIET)$(CC) $(CFLAGS_TUT) -MMD -c $< -o $@

%.o : %.cpp
	@echo " CXX " $@
	$(QUIET)$(CC) $(CFLAGS_TUT) -MMD -c $< -o $@

clean:
	rm -f $(OBJECTS_TUT) $(OBJECTS_TUT:.o=.d) $(BIN_TUT)
	
install:
	cp -f $(APPNAME) $(DESTDIR)/.
	
	
-include $(OBJECTS_TUT:.o=.d)
