#SYNOPSIS:
#
##   make [all]  - makes everything.
#   make TARGET - makes the given target.
#   #   make clean  - removes all files generated by make.

# Flags passed to the preprocessor.
CPPFLAGS += -g -Wall -Wextra ${TRICK_SYSTEM_CXXFLAGS} -I../include -I${TRICK_HOME}/include ${CXXFLAGS} ${TRICK_TEST_FLAGS}

# TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick_units.a
EXEC_LINK_LIBS += -L${GTEST_HOME}/lib64 -L${GTEST_HOME}/lib -lgtest -lgtest_main

#Added pthreads for Ubuntu
EXEC_LINK_LIBS += -lpthread

OTHER_OBJECTS = ../obj/*.o

TESTS = TEST_var_binary_parser

GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
                $(GTEST_DIR)/include/gtest/internal/*.h

all : $(TESTS) test

test: $(TESTS)
	./TEST_var_binary_parser --gtest_output=xml:${TRICK_HOME}/trick_test/TEST_var_binary_parser.xml

clean :
	rm -f $(TESTS)
	rm -f *.o

TEST_var_binary_parser.o : TEST_var_binary_parser.cc $(OTHER_OBJECTS)
	$(CXX) $(CPPFLAGS) -c $<

TEST_var_binary_parser : TEST_var_binary_parser.o $(OTHER_OBJECTS)
	@echo 'Building TEST_var_binary_parser'
	$(CXX) $(TRICK_SYSTEM_LDFLAGS) $(CPPFLAGS) -o $@ $^ -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(LIBS) $(EXEC_LINK_LIBS)
