-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 1017 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# AM335x PRU Package Paths
#
PRU_INC=/home/tceylan/bbb/git/am335x_pru_package/pru_sw/app_loader/include
PRU_LIB=/home/tceylan/bbb/git/am335x_pru_package/pru_sw/app_loader/lib
PRU_PASM=/home/tceylan/bbb/git/am335x_pru_package/pru_sw/utils/pasm
#
# Cross compile (Sample for Ubuntu)
#
NAME=sample
CPP=arm-linux-gnueabihf-g++-4.6
CPPFLAGS=-g -O2 -MMD -fno-exceptions -fno-rtti -I$(PRU_INC)
LDFLAGS=-lrt -L$(PRU_LIB) -lprussdrv -static
OBJDIR = obj
SOURCES := $(wildcard *.cpp)
.PHONY: clean push all
OBJECTS := $(SOURCES:%.cpp=$(OBJDIR)/%.o)
all: $(OBJDIR)/$(NAME) $(OBJDIR)/sonar.bin
$(OBJDIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) -c -o $@ $<
$(OBJDIR)/$(NAME) : $(OBJECTS)
$(CPP) -o $@ $^ $(LDFLAGS)
#
# compile pru binary using PRU assembler
#
$(OBJDIR)/sonar.bin : sonar.p sonar.hp sonar_common.hp
$(PRU_PASM) -V3 -b sonar.p
mv -f sonar.bin $(OBJDIR)/sonar.bin
chmod gou+rx $(OBJDIR)/sonar.bin
clean :
rm -f $(OBJDIR)/*.o $(OBJDIR)/*.d $(OBJDIR)/$(NAME) $(OBJDIR)/sonar.bin
-include $(OBJECTS:.o=.d)