Commit f9f0c853 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

Fix embedding of files

parent da7b73be
......@@ -182,6 +182,9 @@ $(O)/.objs/%.o: $(O)/.gen/%.c
$(Q)$(CC) $(CFLAGS_ALL) -c $< -o $@ -MD -MF $(patsubst %.o,%.pre,$(subst .objs/,.deps/,$@))
$(Q)$(S)/build/normalize_dep_file.pl $(O) $(patsubst %.o,%.pre,$(subst .objs/,.deps/,$@)) >$(patsubst %.o,%.d,$(subst .objs/,.deps/,$@))
# Make sure the intermediate file is not deleted and more building is triggered
.PRECIOUS: $(O)/.gen/%.embed.c
$(O)/.gen/%.embed.c: $(O)/.gen/%.embedlist
$(M) EMBED $@
$(Q)mkdir -p $(dir $@ $(subst .gen/,.deps/,$@))
......
......@@ -44,18 +44,18 @@ my %idx;
while (<$input>) {
chomp;
if (my ($idx, $type) = /^idx\s+(\w+)\s+(\w+)/) {
if (my ($idx, $type) = /^idx\s+(\S+)\s+(\S+)/) {
# Please generate an index into variable and type given
print $output "struct $type $idx\[\] = {\n";
print $output " { \"$_\", $_, $idx{$_} },\n" for sort keys %idx;
print $output " { NULL, 0 }\n";
print $output " { NULL, NULL, 0 }\n";
print $output "};\n";
# And reset the index, so we can generate more than one.
%idx = ();
} elsif (my ($passthrough) = /^\|(.*)/) {
# Include a line
print $output "$passthrough\n";
} elsif (my ($name, $path) = /^(\w+)\s+(\S+)\s*$/) {
} elsif (my ($name, $path) = /^(\S+)\s+(\S+)\s*$/) {
# Embed a file as an array
dep $path;
open my $f, '<', $path or die "Couldn't read file '$path': $!\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment