summaryrefslogtreecommitdiff
path: root/Makefile
blob: a9fcdd13761ee9d2be9d304530d135674644c482 (plain)
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
CC?=$(CROSS_COMPILE)gcc
KERNEL_DIR?=../linux
KERNEL_BUILD_DIR?=$(KERNEL_DIR)
# Need a dtc new enough to handle the DTC options.
DTC?=/usr/bin/dtc

MTCPMHS_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtcpmhs/*.dtso))
MTCDT_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtcdt/*.dtso))
MTRV1_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtrv1/*.dtso))
MTCAP_DTBO_OBJECTS:= $(patsubst %.dtso,%.dtbo,$(wildcard mtcap/*.dtso))

%.pre.dtso: %.dtso
	$(CC) -E -nostdinc -I$(KERNEL_DIR)/include -I$(KERNEL_DIR)/arch/arm/boot/dts -x assembler-with-cpp -undef -o $@ $^

%.dtbo: %.pre.dtso
	$(DTC) $(DTC_OPTIONS) -I dts -O dtb -o $@ $^

%.itb: %.its %_dtbos
	mkimage -D "-i$(KERNEL_BUILD_DIR)/arch/arm/boot/ -i$(KERNEL_BUILD_DIR)/arch/arm/boot/dts -p 1000 $(DTC_OPTIONS)" -f $< $@

mtcdt_dtbos: $(MTCDT_DTBO_OBJECTS)
mtrv1_dtbos: $(MTRV1_DTBO_OBJECTS)
mtcap_dtbos: $(MTCAP_DTBO_OBJECTS)
mtcpmhs_dtbos: $(MTCPMHS_DTBO_OBJECTS)
.PHONY: clean
clean:
	rm -f */*.dtbo *.itb