Skip to content

Commit

Permalink
Fixex include dirs. Also include pru support package include dirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
l4m4re committed Oct 3, 2017
1 parent f3a4faa commit 8a9f11a
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions apps/adc/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
PRU_COMPILER_DIR=/usr
PRU_C_FLAGS=--silicon_version=2 --hardware_mac=on -i$(PRU_COMPILER_DIR)/include -i$(PRU_COMPILER_DIR)/lib
PRU_COMPILER_DIR=/usr/share/ti/cgt-pru
PRU_PKG_INC_DIR=/opt/source/pru-software-support-package/include
PRU_C_FLAGS=--silicon_version=2 --hardware_mac=on -i$(PRU_COMPILER_DIR)/include -i$(PRU_COMPILER_DIR)/lib -i$(PRU_PKG_INC_DIR) -i$(PRU_PKG_INC_DIR)/am335x
PRU_LD_FLAGS=-llibc.a

HOST_C_FLAGS += -Wall -g -O2 -mtune=cortex-a8 -march=armv7-a -I/usr/local/include
#HOST_LD_FLAGS += /usr/lib/libprussdrv.a -lpthread -lsndfile
HOST_LD_FLAGS += -lprussdrv -lpthread -lsndfile

FIND_ADDRESS_COMMAND=`$(PRU_COMPILER_DIR)/bin/dispru pru.elf | grep _c_int00 | cut -f1 -d\ `
FIND_ADDRESS_COMMAND=`dispru pru.elf | grep _c_int00 | cut -f1 -d\ `

.PHONY: all
all:
# Compile pru.c into pro.obj
$(PRU_COMPILER_DIR)/bin/clpru $(PRU_C_FLAGS) -c pru.c
clpru $(PRU_C_FLAGS) -c pru.c

# Link pru.obj with libraries and output pru.map and pru.elf
$(PRU_COMPILER_DIR)/bin/clpru $(PRU_C_FLAGS) -z pru.obj $(PRU_LD_FLAGS) \
clpru $(PRU_C_FLAGS) -z pru.obj $(PRU_LD_FLAGS) \
-m pru.map -o pru.elf AM3359_PRU.cmd

# Convert pru.elf into text.bin and data.bin
$(PRU_COMPILER_DIR)/bin/hexpru ./bin.cmd ./pru.elf
hexpru ./bin.cmd ./pru.elf

# Find address of start of program and compile host program
export START_ADDR=0x$(FIND_ADDRESS_COMMAND) && \
Expand All @@ -27,11 +28,11 @@ all:

.PHONY: clean
clean:
-rm *.obj
-rm *.map
-rm *.elf
-rm *.bin
-rm *.o
-rm host
-rm out.wav
-rm -f *.obj
-rm -f *.map
-rm -f *.elf
-rm -f *.bin
-rm -f *.o
-rm -f host
-rm -f out.wav

0 comments on commit 8a9f11a

Please sign in to comment.