blob: 60a76f32e4e16b486b176cd3852d5cb57d504279 [file] [log] [blame]
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +02001EPIPHANY_HOME=/opt/adapteva/esdk
2#host compiler path
Anand Prakashf3644672020-08-21 15:11:08 +02003LCC=/opt/linaro/bin/arm-linux-gnueabihf-gcc
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +02004#device compiler path
5CC=e-gcc
6#FreeRTOS dependencies
7CFLAGS=-I.
8FREERTOSSRC=../../RTFP_RTOS_KERNEL_PATCHED/FreeRTOS/Source
9INCLUDES= -g -I$(FREERTOSSRC)/include -I$(FREERTOSSRC)/portable/GCC/Epiphany -I.
Anand Prakashf3644672020-08-21 15:11:08 +020010DEPS = $(FREERTOSSRC)/portable/GCC/Epiphany/portmacro.h Makefile RTFParallellaConfig.h FreeRTOSConfig.h c2c.h debugFlags.h AmaltheaConverter.h taskCode.h ParallellaUtils.h trace_utils_BTF.h
11DEPSHOST = RTFParallellaConfig.h model_enumerations.h host_utils.h trace_utils_BTF.h
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020012#Epiphany SDK dependencies
13ESDK=${EPIPHANY_HOME}
14ELIBS=${ESDK}/tools/host.armv7l/lib
15EINCS=${ESDK}/tools/host.armv7l/include
16ELDF=${ESDK}/bsps/current/fast.ldf
17EHDF=${EPIPHANY_HDF}
18#search paths for C source code files
19vpath %.c .:$(FREERTOSSRC)/:$(FREERTOSSRC)/portable/MemMang:$(FREERTOSSRC)/portable/GCC/Epiphany:/
20#search path for assembly listings
21vpath %.s $(FREERTOSSRC)/portable/GCC/Epiphany
22#main target
23all: host_main_example1 armcode core0_main.elf core1_main.elf
24 @echo build status : successful
25run: armcode core0_main.elf core1_main.elf
26 @echo build status : successful
27
28example1: host_main_example1 core0_main.elf core1_main.elf
29 @echo build status : successful
30
31#rule for every device target
Mahmoud Bazzal091c21b2019-09-26 15:49:21 +020032%.elf: $(ELDF) tasks.o queue.o list.o portasm.o port.o heap_1.o c2c.o debugFlags.o AmaltheaConverter.o taskCode.o ParallellaUtils.o shared_comms.o label_man_core0.o %.o
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020033 $(CC) -g -T$< -Wl,--gc-sections -o $@ $(filter-out $<,$^) -le-lib
34
35#host target
36armcode: armcode.c $(DEPSHOST)
Anand Prakashf3644672020-08-21 15:11:08 +020037 $(LCC) $< -o $@ host_utils.c model_enumerations.c trace_utils_BTF.c -I ${EINCS} -L ${ELIBS} -lpal -le-hal -le-loader -lpthread
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020038host_main_example1: host_main_example1.c $(DEPSHOST)
Anand Prakashf3644672020-08-21 15:11:08 +020039 $(LCC) $< -o $@ host_utils.c model_enumerations.c trace_utils_BTF.c -I ${EINCS} -L ${ELIBS} -lpal -le-hal -le-loader -lpthread
Mahmoud Bazzal69a0a242019-08-22 17:36:17 +020040
41#clean target
42clean:
43 rm -f *.o *.srec *.elf armcode host_main_example1
44
45.SECONDARY:
46%.o: %.c $(DEPS)
47 $(CC) -fdata-sections -ffunction-sections -c -o $@ $< $(INCLUDES)
48
49%.o: %.s $(DEPS)
50 $(CC) -c -o $@ $< $(INCLUDES)
51