mirror of https://github.com/ArduPilot/ardupilot
61 lines
1.2 KiB
Makefile
61 lines
1.2 KiB
Makefile
|
#
|
||
|
# Makefile for PWM PRU program
|
||
|
# It is assumed that the PRU compiler environment has been set
|
||
|
#
|
||
|
|
||
|
.PHONY: all clean
|
||
|
|
||
|
all: testpru1.stripped testpru1.lst
|
||
|
|
||
|
CC=clpru
|
||
|
LD=lnkpru
|
||
|
AR=arpru
|
||
|
OBJDUMP=dispru
|
||
|
STRIP=strippru
|
||
|
|
||
|
# -v3 PRU version 3
|
||
|
# --c99 C99 support
|
||
|
# --gcc Enable GCC extensions
|
||
|
# -O3 Optimization level maximum
|
||
|
# --printf_support=minimal Minimal printf
|
||
|
# -ppd Generate dependencies *.pp
|
||
|
# -ppa Continue after generating deps
|
||
|
# -DDEBUG Enable debug
|
||
|
# CFLAGS= -v3 --c99 --gcc -O3 --printf_support=minimal -ppd -ppa -DDEBUG
|
||
|
CFLAGS= -v3 -s -al -O3 --c99 --gcc --printf_support=minimal --symdebug:none
|
||
|
|
||
|
# -cr Link using RAM auto init model (loader assisted)
|
||
|
# -x Reread libs until no unresolved symbols found
|
||
|
LDFLAGS=-cr --diag_warning=225 -llnk-am33xx.cmd -x
|
||
|
|
||
|
STRIPFLAGS=-p
|
||
|
|
||
|
OBJS1:=testpru1.obj
|
||
|
|
||
|
%.obj: %.c
|
||
|
$(CC) $(CFLAGS) -c $< -ea=.s
|
||
|
|
||
|
%.obj: %.asm
|
||
|
$(CC) $(CFLAGS) -c $<
|
||
|
|
||
|
testpru1: $(OBJS1)
|
||
|
$(CC) $(CFLAGS) $^ -q -z $(LDFLAGS) -o $@
|
||
|
|
||
|
testpru1.stripped: testpru1
|
||
|
$(STRIP) $(STRIPFLAGS) $< -o $@
|
||
|
|
||
|
testpru1.lst: testpru1
|
||
|
$(OBJDUMP) -1 $< > $@
|
||
|
|
||
|
clean:
|
||
|
rm -f \
|
||
|
testpru1 testpru1.asm \
|
||
|
*.obj *.lst *.out *.stripped \
|
||
|
tags
|
||
|
|
||
|
distclean: clean
|
||
|
rm -f *.pp
|
||
|
|
||
|
# include any generated deps
|
||
|
-include $(patsubst %.obj,%.pp,$(OBJS))
|