]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] drop stringify, .script.h instead of .string
authorRay Strode <rstrode@redhat.com>
Wed, 5 Aug 2009 19:41:37 +0000 (15:41 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 5 Aug 2009 19:41:37 +0000 (15:41 -0400)
stringify.py is written in perl, but doesn't do much to justify the
dependency.  We now just do sed in the Makefile.  Also, rename
.string to .script.h since that's a little more conventional.

src/plugins/splash/script/Makefile.am
src/plugins/splash/script/script-lib-image.c
src/plugins/splash/script/script-lib-math.c
src/plugins/splash/script/script-lib-plymouth.c
src/plugins/splash/script/script-lib-sprite.c
src/plugins/splash/script/stringify.pl [deleted file]

index 8cafc3ef29d9402b2a6bb3c47beb30017819de0d..6dde7cbc7b041bbbc36204468f137c591b3b9100 100644 (file)
@@ -45,16 +45,14 @@ script_la_SOURCES = $(srcdir)/plugin.c                                        \
                     $(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;'                                                         \
+           $< > $@
index e2ddb21c8bd9f2a4585c2bb00cb93292dd74413c..5ea2f0f6470c8fa7b6c0b2bcfe2f3a41418a1fc3 100644 (file)
@@ -35,8 +35,7 @@
 
 #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)
 {
index 84e2a1cf3b460534d2db7e419d85a67aaf6579be..ecc1a90fc4dcc3ae7a5f6c1a22ca3728cb3eae0e 100644 (file)
@@ -34,9 +34,7 @@
 
 #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)
index fd9fa1547a028e3f715420120c53e85ce20a6d7f..d552af83f3d37867023f9294bbdc3baaf4f18329 100644 (file)
@@ -33,9 +33,7 @@
 
 #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)
index a03663537f2af28df5f0e8820c655d262bd7165e..d6c1773ff612eb9f703355457a1fc54e9223cfbe 100644 (file)
@@ -35,8 +35,7 @@
 #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)
 {
diff --git a/src/plugins/splash/script/stringify.pl b/src/plugins/splash/script/stringify.pl
deleted file mode 100755 (executable)
index a0c3b45..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /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 ";";