Skip to content

Commit

Permalink
Require GNU sed
Browse files Browse the repository at this point in the history
MacOS version silently produces wrong results as it doesn't support GNU escapes.
Can this be rewritten, perhaps with python script?
  • Loading branch information
mikee47 committed Jun 16, 2024
1 parent fdee65a commit 6b0b07a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ endif

JERRY_TYPES_H := $(COMPONENT_PATH)/src/include/Jerryscript/.typemaps.h

ifeq ($(UNAME),Darwin)
SED ?= gsed
else
SED ?= sed
endif

# Generate MAP #define for a jerryscript C enumeration
# $1 -> e.g. JERRY_FUNCTION_TYPE_
# $2 -> source file
Expand All @@ -145,7 +151,7 @@ define JerryGetTypes
$(Q) printf "#define $(if $3,$3_,$1)MAP(XX)" >> $@
$(Q) $(foreach v,\
$(shell $(AWK) -F " |,|=" '/$1/ { sub(/^ +$1/,""); print $$1 }' $(JERRYSCRIPT_ROOT)/jerry-core/include/jerryscript-$2.h),\
printf " \\\\\n\tXX($1$v, %s)" $$( echo "$v" | sed -E 's/(.*)/\L\1/; s/(^|_)([a-z0-9])/\U\2/g' ) >> $@; )
printf " \\\\\n\tXX($1$v, %s)" $$( echo "$v" | $(SED) -E 's/(.*)/\L\1/; s/(^|_)([a-z0-9])/\U\2/g' ) >> $@; )
$(Q) printf "\n\n" >> $@
endef

Expand Down

0 comments on commit 6b0b07a

Please sign in to comment.