[script] drop stringify, .script.h instead of .string

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.
This commit is contained in:
Ray Strode 2009-08-05 15:41:37 -04:00
parent ce77a0e8d3
commit 93a16e060c
6 changed files with 13 additions and 35 deletions

View 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;' \
$< > $@

View 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)
{

View 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)

View 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)

View 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)
{

View file

@ -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 ";";