-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (34 loc) · 798 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
#
# Execute 'make' to create prucode.bin and mytest
# Other options:
# make clean
# make all
# make pru
# make project
# make prucode
# make clean
#
pru = prucode
project = pru_pwm
LIB_PATH = .
LIBRARIES = pthread prussdrv
INCLUDES = -I. ${LIB_PATH}
SOURCES = mytest.c
EXTRA_DEFINE =
CCCFLAGS = $(EXTRA_DEFINE)
CC = gcc
CFLAGS = $(EXTRA_DEFINE)
PASM = pasm
all : $(pru) $(project)
pru : $(pru)
project: $(project)
$(project) : $(project:%=%.c)
$(CC) $(CFLAGS) -c -o [email protected] [email protected]
$(CC) [email protected] $(LIB_PATH:%=-L%) $(LIBRARIES:%=-l%) -o $@
clean :
rm -rf *.o *.bin $(project) core *~
$(pru) : $(pru:%=%.p)
$(PASM) -b [email protected]
.SUFFIXES: .c.d
%.d: %.c
$(SHELL) -ec "$(CC) -M $(CPPFLAGS) $< | sed 's/$*\\.o[ :]*/$@ &/g' > $@" -include $(SOURCES:.c=.d)