# MakeFile function     :: MakeFile for compiling RTC test suite 

top_srcdir              ?= ../../../../

include $(top_srcdir)/include/mk/env_pre.mk

INSTALL_DIR             := ../../../bin

FILTER_OUT_DIRS         :=

# We don't want to copy over the Makefile
UNWANTED_FILES          := Makefile

INSTALL_MODE            := 00755
#INSTALL_TARGETS         := $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(wildcard $(abs_srcdir)/*))))

CFLAGS          += -g -Wall -O1 -fomit-frame-pointer
LDFLAGS         += -g -static
INCLUDES        = -I $(KLINUX_SRCDIR)/usr/include/ -I $(KLINUX_SRCDIR)/include/ -I src/interface/common -I ../utils/user -I ../../ddt-utils/user

#List of source files- Update this on adding a new C file
SOURCES := \
        ../../ddt-utils/user/st_fileapi.c \
        src/interface/common/st_rtc_common.c \
        src/parser/st_rtc_parser.c \
        src/testcases/st_rtc_ioctl.c \

MAKE_TARGETS            := rtc_tests

all: rtc_tests

rtc_tests:
	$(CC) $(CFLAGS) $(LDFLAGS) -o rtc_tests ${INCLUDES} ${SOURCES}

#include $(top_srcdir)/include/mk/generic_leaf_target.mk

install:
	@-ln -f $(MAKE_TARGETS) ../../../bin/
	@echo "***********************************************" ;
	@echo "** INSTALL : $(MAKE_TARGETS)  " ;
	@echo "***********************************************" ;
	@echo

clean:
	rm -f $(MAKE_TARGETS)
