[ion][escher] Revert previous commit: move inliner back to escher

This commit is contained in:
Émilie Feral
2020-09-04 15:05:35 +02:00
committed by EmilieNumworks
parent 4ae39f56fd
commit ad1ef783ce
4 changed files with 31 additions and 38 deletions

View File

@@ -91,3 +91,34 @@ escher_src += $(addprefix escher/src/,\
tests_src += $(addprefix escher/test/,\
layout_field.cpp\
)
$(eval $(call rule_for, \
HOSTCC, \
escher/image/inliner, \
escher/image/inliner.c $(addprefix ion/src/external/lz4/, lz4.c lz4hc.c), \
$$(HOSTCC) -std=c99 `libpng-config --cflags` $$^ `libpng-config --ldflags` -o $$@, \
global \
))
INLINER := $(BUILD_DIR)/escher/image/inliner
.PRECIOUS: $(BUILD_DIR)/%.h $(BUILD_DIR)/%.cpp
$(eval $(call rule_for, \
INLINER, \
%.h %.cpp, \
%.png $$(INLINER), \
$$(INLINER) $$< $$(basename $$@).h $$(basename $$@).cpp, \
global \
))
# Mark a .cpp file as depending on a .png one
# This is called with $1 = code.cpp and $2 = image.png
# First, we mark code.o as requiring image.o. Rules will take care of inlining
# the PNG and building the inlined cpp file. Second, we add the directory
# corresponding to the one of code.cpp in the output dir as a header search
# path. Since $1 can be a list, we have to map with foreach.
define depends_on_image
$(call object_for,$(1)): $(call object_for,$(2))
$(call object_for,$(1)): SFLAGS += $(foreach d,$(sort $(dir $(call object_for,$(1)))),-I$(d))
escher_src += $(2)
endef

View File

@@ -11,38 +11,6 @@ ifndef ION_KEYBOARD_LAYOUT
endif
SFLAGS += -Iion/include/ion/keyboard/$(ION_KEYBOARD_LAYOUT)
# Image inliner
$(eval $(call rule_for, \
HOSTCC, \
ion/image/inliner, \
ion/image/inliner.c $(addprefix ion/src/external/lz4/, lz4.c lz4hc.c), \
$$(HOSTCC) -std=c99 `libpng-config --cflags` $$^ `libpng-config --ldflags` -o $$@, \
global \
))
INLINER := $(BUILD_DIR)/ion/image/inliner
.PRECIOUS: $(BUILD_DIR)/%.h $(BUILD_DIR)/%.cpp
$(eval $(call rule_for, \
INLINER, \
%.h %.cpp, \
%.png $$(INLINER), \
$$(INLINER) $$< $$(basename $$@).h $$(basename $$@).cpp, \
global \
))
# Mark a .cpp file as depending on a .png one
# This is called with $1 = code.cpp and $2 = image.png
# First, we mark code.o as requiring image.o. Rules will take care of inlining
# the PNG and building the inlined cpp file. Second, we add the directory
# corresponding to the one of code.cpp in the output dir as a header search
# path. Since $1 can be a list, we have to map with foreach.
define depends_on_image
$(call object_for,$(1)): $(call object_for,$(2))
$(call object_for,$(1)): SFLAGS += $(foreach d,$(sort $(dir $(call object_for,$(1)))),-I$(d))
ion_src += $(2)
endef
include ion/src/$(PLATFORM)/Makefile
-include ion/test/$(PLATFORM)/Makefile
include ion/src/shared/tools/Makefile

View File

@@ -26,11 +26,5 @@ ion_src += $(addprefix ion/src/simulator/shared/, \
timing.cpp \
)
$(eval $(call depends_on_image,ion/src/simulator/shared/layout.cpp,ion/src/simulator/assets/key_layouts/horizontal_arrow.png))
$(eval $(call depends_on_image,ion/src/simulator/shared/layout.cpp,ion/src/simulator/assets/key_layouts/large_squircle.png))
$(eval $(call depends_on_image,ion/src/simulator/shared/layout.cpp,ion/src/simulator/assets/key_layouts/round.png))
$(eval $(call depends_on_image,ion/src/simulator/shared/layout.cpp,ion/src/simulator/assets/key_layouts/small_squircle.png))
$(eval $(call depends_on_image,ion/src/simulator/shared/layout.cpp,ion/src/simulator/assets/key_layouts/vertical_arrow.png))
include ion/src/simulator/$(TARGET)/Makefile
include ion/src/simulator/external/Makefile