From 93784423ef31cf0cc6b99f96bbd403e260b2b1f1 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 27 Sep 2016 14:03:29 +0200 Subject: [PATCH] [escher] Use the inliner to convert PNGs to .h/.cpp Change-Id: Iabf6850e6a413f8c02768776887d1566c2ecb48c --- Makefile | 2 +- escher/Makefile | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6d531edcf..1d540835a 100644 --- a/Makefile +++ b/Makefile @@ -61,8 +61,8 @@ endif include ion/Makefile include kandinsky/Makefile include poincare/Makefile -include escher/Makefile include apps/Makefile +include escher/Makefile # Escher should be included after apps as it needs to know which images to inline include quiz/Makefile # Quiz should be included at the end dependencies = $(objs:.o=.d) diff --git a/escher/Makefile b/escher/Makefile index 37ea7ede2..68cad3b0c 100644 --- a/escher/Makefile +++ b/escher/Makefile @@ -27,3 +27,20 @@ objs += $(addprefix escher/src/,\ view_controller.o\ window.o\ ) + +INLINER := escher/image/inliner + +$(INLINER): escher/image/inliner.c + @echo "HOSTCC $@" + @$(HOSTCC) `libpng-config --cflags` `libpng-config --ldflags` $< -o $@ + +inline_image_headers := $(inline_images:.png=.h) +inline_image_sources := $(inline_images:.png=.cpp) +inline_image_objs := $(inline_images:.png=.o) + +$(inline_image_sources) : %.cpp : %.png $(INLINER) + @echo "INLINER $@" + @$(INLINER) $< + +objs += $(inline_image_objs) +products += $(INLINER) $(inline_image_headers) $(inline_image_sources)