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

# iutest root directory
IUTEST_DIR = ../..

# sample code
USER_DIR = ../../samples

# Flags passed to the preprocessor.
CFLAGS += -I$(IUTEST_DIR)/include

CC = gcc
#
# Flags passed to the C compiler.
CFLAGS += -g -Wall -Wextra
CFLAGS += $(DEFS)

# All tests produced by this Makefile.  Remember to add new tests you
# created to the list.
TESTS = sample

# All iutest headers.  Usually you shouldn't change this
# definition.
IUTEST_HEADERS = $(IUTEST_DIR)/include/*.h \
                 $(IUTEST_DIR)/include/internal/*.h \
                 $(IUTEST_DIR)/include/listener/*.h

# House-keeping build targets.

all : $(TESTS)

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

# Builds a sample test.  

main.o : $(USER_DIR)/main.c $(IUTEST_HEADERS) Makefile
	$(CC) $(CFLAGS) -c $(USER_DIR)/main.c

sub.o : $(USER_DIR)/sub.c $(IUTEST_HEADERS) Makefile
	$(CC) $(CFLAGS) -c $(USER_DIR)/sub.c

sample : main.o sub.o
	$(CC) $^ -o $@
