$(srcdir)/script-lib-math.script
MAINTAINERCLEANFILES = Makefile.in
-CLEANFILES = *.string
+CLEANFILES = *.script.h
-BUILT_SOURCES = script-lib-image.string script-lib-sprite.string script-lib-math.string script-lib-plymouth.string
+BUILT_SOURCES = script-lib-image.script.h script-lib-sprite.script.h script-lib-math.script.h script-lib-plymouth.script.h
-EXTRA_DIST = stringify.pl
-
-%.string: %.script stringify.pl
- $(srcdir)/stringify.pl < $< > $@
-
-script-lib-image.c : script-lib-image.string
-script-lib-sprite.c : script-lib-sprite.string
-script-lib-math.c : script-lib-math.string
-script-lib-plymouth.c : script-lib-plymouth.string
+%.script.h: %.script
+ sed -e 's/\\/\\\\/g' \
+ -e 's/"/\\"/g' \
+ -e 's/\(.*\)/ "\1\\n"/g' \
+ -e '1istatic const char* $(subst -,_,$(@:.script.h=_string)) =' \
+ -e '$$a;' \
+ $< > $@
#include "config.h"
-#define STRINGIFY_VAR script_lib_image_string
-#include "script-lib-image.string"
+#include "script-lib-image.script.h"
static void image_free (script_obj_t *obj)
{
#include "config.h"
-#define STRINGIFY_VAR script_lib_math_string
-
-#include "script-lib-math.string"
+#include "script-lib-math.script.h"
static script_return_t script_lib_math_float_from_float_function (script_state_t *state,
void *user_data)
#include "config.h"
-#define STRINGIFY_VAR script_lib_plymouth_string
-
-#include "script-lib-plymouth.string"
+#include "script-lib-plymouth.script.h"
static script_return_t plymouth_set_function (script_state_t *state,
void *user_data)
#include <stdlib.h>
#include <math.h>
-#define STRINGIFY_VAR script_lib_sprite_string
-#include "script-lib-sprite.string"
+#include "script-lib-sprite.script.h"
static void sprite_free (script_obj_t *obj)
{
+++ /dev/null
-#! /bin/sh
-exec perl -x $0 ${1+"$@"}
- if 0;
-#!perl
-
-print "static const char* STRINGIFY_VAR = ";
-while (<>)
-{
- chomp;
- s/\\/\\\\/g;
- s/"/\\"/g;
- print "\"$_\\n\"\n";
-}
-print ";";