#
#   @copyright Copyright 2022 Antaris, Inc.
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#
TOP_DIR=../../../../
include $(TOP_DIR)/Makefile.def

# define any directories containing header files other than /usr/include
INCLUDES = -I inc/\
           -I ../../lib/inc/\
           -I ../sock_utils/inc/\
           -I $(TOP_DIR)/exo_lib/security/mbedtls/include\
           -I $(TOP_DIR)/exo_lib/security/hmac/src/\
           -I $(TOP_DIR)/exo_lib/security/libcrc-2.0/include\
           -I $(TOP_DIR)/includes/\
           -I $(TOP_DIR)/exo_os/exo_osal/memory_management/inc/\
           -I $(TOP_DIR)/exo_os/exo_ral/exo_ral_common/inc/\
           -I $(TOP_DIR)/exo_os/exo_osal/exo_osal_common/inc/\
           -I $(TOP_DIR)/exo_os/exo_osal/task_management/inc/\
           -I $(TOP_DIR)/exo_os/exo_osal/ipc_mbmr/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/common/inc/\
           -I$(TOP_DIR)drivers/bsp/janus1/inc/\
           -I$(TOP_DIR)drivers/bsp/janus2/inc/\
           -I$(TOP_DIR)drivers/bsp/stm32f765x/inc/\
       	   -I$(TOP_DIR)drivers/bsp/disco_f769ni/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/rcc/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/adc/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/exti/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/gpio/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/dma/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/cortex/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/can/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/ethernet/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/flash/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/wdg/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/i2c/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/pwr/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/spi/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/tmr/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/uart/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/usb/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/nor_flash/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/sdram/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/qspi/inc/\
           -I $(TOP_DIR)/drivers/io_drivers/io_drivers_stm32f7xx/fmc/inc/\
           -I $(TOP_DIR)/exo_os/exo_ral/cpu_arch/stm32f7xx/inc/\
           -I $(TOP_DIR)/includes

# List of source files required for compilation
SRC = src/mfcc_sample_app.c\
      src/mfcc_tc_tm_sample.c\

# Command to compile source files to intermediate object files
all:
	rm -rf obj/
	$(CC) $(CFLAGS) -c $(SRC) $(INCLUDES)
	mkdir obj
	mv *.o obj/
# Command to delete intermediate object files
clean:
	rm -rf obj/
