Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 1 | EPIPHANY_HOME=/opt/adapteva/esdk |
| 2 | #host compiler path |
Anand Prakash | f364467 | 2020-08-21 15:11:08 +0200 | [diff] [blame] | 3 | LCC=/opt/linaro/bin/arm-linux-gnueabihf-gcc |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 4 | #device compiler path |
| 5 | CC=e-gcc |
| 6 | #FreeRTOS dependencies |
| 7 | CFLAGS=-I. |
| 8 | FREERTOSSRC=../../RTFP_RTOS_KERNEL_PATCHED/FreeRTOS/Source |
| 9 | INCLUDES= -g -I$(FREERTOSSRC)/include -I$(FREERTOSSRC)/portable/GCC/Epiphany -I. |
Anand Prakash | f364467 | 2020-08-21 15:11:08 +0200 | [diff] [blame] | 10 | DEPS = $(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 |
| 11 | DEPSHOST = RTFParallellaConfig.h model_enumerations.h host_utils.h trace_utils_BTF.h |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 12 | #Epiphany SDK dependencies |
| 13 | ESDK=${EPIPHANY_HOME} |
| 14 | ELIBS=${ESDK}/tools/host.armv7l/lib |
| 15 | EINCS=${ESDK}/tools/host.armv7l/include |
| 16 | ELDF=${ESDK}/bsps/current/fast.ldf |
| 17 | EHDF=${EPIPHANY_HDF} |
| 18 | #search paths for C source code files |
| 19 | vpath %.c .:$(FREERTOSSRC)/:$(FREERTOSSRC)/portable/MemMang:$(FREERTOSSRC)/portable/GCC/Epiphany:/ |
| 20 | #search path for assembly listings |
| 21 | vpath %.s $(FREERTOSSRC)/portable/GCC/Epiphany |
| 22 | #main target |
| 23 | all: host_main_example1 armcode core0_main.elf core1_main.elf |
| 24 | @echo build status : successful |
| 25 | run: armcode core0_main.elf core1_main.elf |
| 26 | @echo build status : successful |
| 27 | |
| 28 | example1: host_main_example1 core0_main.elf core1_main.elf |
| 29 | @echo build status : successful |
| 30 | |
| 31 | #rule for every device target |
Mahmoud Bazzal | 091c21b | 2019-09-26 15:49:21 +0200 | [diff] [blame] | 32 | %.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 Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 33 | $(CC) -g -T$< -Wl,--gc-sections -o $@ $(filter-out $<,$^) -le-lib |
| 34 | |
| 35 | #host target |
| 36 | armcode: armcode.c $(DEPSHOST) |
Anand Prakash | f364467 | 2020-08-21 15:11:08 +0200 | [diff] [blame] | 37 | $(LCC) $< -o $@ host_utils.c model_enumerations.c trace_utils_BTF.c -I ${EINCS} -L ${ELIBS} -lpal -le-hal -le-loader -lpthread |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 38 | host_main_example1: host_main_example1.c $(DEPSHOST) |
Anand Prakash | f364467 | 2020-08-21 15:11:08 +0200 | [diff] [blame] | 39 | $(LCC) $< -o $@ host_utils.c model_enumerations.c trace_utils_BTF.c -I ${EINCS} -L ${ELIBS} -lpal -le-hal -le-loader -lpthread |
Mahmoud Bazzal | 69a0a24 | 2019-08-22 17:36:17 +0200 | [diff] [blame] | 40 | |
| 41 | #clean target |
| 42 | clean: |
| 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 | |