-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
63 lines (51 loc) · 1.65 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# picberry Makefile
#
#
CC = $(CROSS_COMPILE)g++
CFLAGS = -Wall -O2 -s -std=c++11
TARGET = picberry
PREFIX = /usr
BINDIR = $(PREFIX)/bin
SRCDIR = src
BUILDDIR = build
MKDIR = mkdir -p
DEVICES = $(BUILDDIR)/devices/dspic33e.o \
$(BUILDDIR)/devices/dspic33f.o \
$(BUILDDIR)/devices/pic10f322.o \
$(BUILDDIR)/devices/pic18fj.o \
$(BUILDDIR)/devices/pic24fjxxxga0xx.o \
$(BUILDDIR)/devices/pic24fjxxxga3xx.o \
$(BUILDDIR)/devices/pic24fjxxga1xx_gb0xx.o \
$(BUILDDIR)/devices/pic24fjxxxga1_gb1.o \
$(BUILDDIR)/devices/pic24fjxxxga2_gb2.o \
$(BUILDDIR)/devices/pic24fxxka1xx.o\
$(BUILDDIR)/devices/pic32.o $(BUILDDIR)/devices/pic32_pe.o
a10: CFLAGS += -DBOARD_A10
raspberrypi: CFLAGS += -DBOARD_RPI
raspberrypi2: CFLAGS += -DBOARD_RPI2
raspberrypi4: CFLAGS += -DBOARD_RPI4
am335x: CFLAGS += -DBOARD_AM335X
default:
@echo "Please specify a target with 'make raspberrypi', 'make a10' or 'make am335x'."
raspberrypi: prepare picberry
raspberrypi2: prepare picberry
raspberrypi4: prepare picberry
a10: prepare picberry
am335x: prepare picberry gpio_test
prepare:
$(MKDIR) $(BUILDDIR)/devices
picberry: $(BUILDDIR)/inhx.o $(DEVICES) $(BUILDDIR)/picberry.o
$(CC) $(CFLAGS) -o $(TARGET) $(BUILDDIR)/inhx.o $(DEVICES) $(BUILDDIR)/picberry.o
gpio_test: $(BUILDDIR)/gpio_test.o
$(CC) $(CFLAGS) -o gpio_test $(BUILDDIR)/gpio_test.o
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
$(BUILDDIR)/devices/%.o: $(SRCDIR)/devices/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
install:
install -m 0755 $(TARGET) $(BINDIR)/$(TARGET)
uninstall:
$(RM) $(BINDIR)/$(TARGET)
clean:
$(RM) $(TARGET) *_test *.o $(BUILDDIR)/*.o $(BUILDDIR)/devices/*.o