forked from cdsteinkuehler/beaglebone-universal-io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 916 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
PREFIX ?= /usr/bin
FIRMWAREPATH ?= /lib/firmware
BUILDPATH = .
SRC = cape-universal-00A0.dts
SRC += cape-universala-00A0.dts
SRC += cape-universaln-00A0.dts
SRC += cape-universalh-00A0.dts
SRC += cape-univ-emmc-00A0.dts
SRC += cape-univ-hdmi-00A0.dts
SRC += cape-univ-audio-00A0.dts
TARGET = config-pin
all: ensure_path build
install: install_overlays install_target
# Compile: create dtbo files from dts files.
$(BUILDPATH)/%.dtbo : %.dts
@echo "Compiling file: $<"
dtc -@ -I dts -O dtb -o $@ $<
ensure_path:
mkdir -p $(BUILDPATH)
mkdir -p $(PREFIX)
mkdir -p $(FIRMWAREPATH)
build : $(SRC:%.dts=$(BUILDPATH)/%.dtbo)
$(FIRMWAREPATH)/%.dtbo : $(BUILDPATH)/%.dtbo
@echo "Installing file: $<"
cp $< $@
install_overlays: $(SRC:%.dts=$(FIRMWAREPATH)/%.dtbo)
install_target:
@echo "Installing config-pin utility"
cp $(TARGET) $(PREFIX)/
chmod +x $(PREFIX)/$(TARGET)
clean:
rm -f $(BUILDPATH)/*.dtbo