diff mbox series

[6/6] meson: replace pc-bios/Makefile

Message ID 20200918204759.225810-7-marcandre.lureau@redhat.com
State New
Headers show
Series Convert pc-bios Makefiles to meson | expand

Commit Message

Marc-André Lureau Sept. 18, 2020, 8:47 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Add an alias target "update-dtb" to recompile the device-tree "sources"
to the "blob" format.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 pc-bios/Makefile    | 19 -------------------
 pc-bios/meson.build | 12 ++++++++++++
 2 files changed, 12 insertions(+), 19 deletions(-)
 delete mode 100644 pc-bios/Makefile
diff mbox series

Patch

diff --git a/pc-bios/Makefile b/pc-bios/Makefile
deleted file mode 100644
index 315288df84..0000000000
--- a/pc-bios/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@ 
-#
-# NOTE: only compilable with x86 cross compile tools
-#
-include ../config-host.mak
-
-DEFINES=
-
-TARGETS=
-
-all: $(TARGETS)
-
-%.o: %.S
-	$(CC) $(DEFINES) -c -o $@ $<
-
-%.dtb: %.dts
-	dtc -I dts -O dtb -o $@ $<
-
-clean:
-	rm -f $(TARGETS) *.o *~
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index d25585ca97..f004df7a4d 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -92,6 +92,18 @@  endif
 subdir('descriptors')
 subdir('keymaps')
 
+dtc = find_program('dtc', required: false)
+if dtc.found()
+  t = []
+  foreach f: ['bamboo.dts', 'canyonlands.dts', 'petalogix-ml605.dts', 'petalogix-s3adsp1800.dts']
+    t += custom_target(f,
+                       input: f,
+                       output: '@BASENAME@' + '.dtb',
+                       command: [dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT@'])
+  endforeach
+  alias_target('update-dtb', t)
+endif
+
 if host_machine.cpu_family() in ['x86', 'x86_64']
   subproject('optionrom')
 endif