aboutsummaryrefslogtreecommitdiffhomepage
path: root/libslang/src/mkfiles/mkmake.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2011-10-14 04:55:05 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2011-10-14 04:55:05 +0200
commit6aa0e0017d7d0cddc006da885946934b06949a91 (patch)
tree66b688ec32e2f91266db760b1762f2a50cc52036 /libslang/src/mkfiles/mkmake.c
parenta966db5b71328f6adf9dd767e64b322a3bd7ed9c (diff)
downloaderlang-slang-fork-6aa0e0017d7d0cddc006da885946934b06949a91.tar.gz
include libslang-1.4.9 and automatically build it and link erlang-slang against it
few (erlang) people will still have libslang-1.4.9 installed or spend time to get it to link against the driver
Diffstat (limited to 'libslang/src/mkfiles/mkmake.c')
-rw-r--r--libslang/src/mkfiles/mkmake.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libslang/src/mkfiles/mkmake.c b/libslang/src/mkfiles/mkmake.c
new file mode 100644
index 0000000..30abfb6
--- /dev/null
+++ b/libslang/src/mkfiles/mkmake.c
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <slang.h>
+#include <stdlib.h>
+
+static void usage (void)
+{
+ fprintf (stderr, "Usage: mkmake [DEF1 [DEF2 ...]]\n");
+ exit (1);
+}
+
+
+int main (int argc, char **argv)
+{
+ char buf[1024];
+ int i;
+ SLPreprocess_Type pt;
+
+ if (isatty (0))
+ usage ();
+
+ SLprep_open_prep (&pt);
+
+ pt.preprocess_char = '!';
+ pt.comment_char = '#';
+ pt.flags = SLPREP_BLANK_LINES_OK | SLPREP_COMMENT_LINES_OK;
+
+ for (i = 1; i < argc; i++)
+ SLdefine_for_ifdef (argv[i]);
+
+ while (NULL != fgets (buf, sizeof (buf) - 1, stdin))
+ {
+ if (SLprep_line_ok (buf, &pt))
+ {
+ fputs (buf, stdout);
+ }
+ }
+
+ SLprep_close_prep (&pt);
+ return 0;
+}
+