Browse Source

Generate org_lexer header file

Andrew Young 8 years ago
parent
commit
394dd80fef
5 changed files with 12 additions and 7 deletions
  1. 1 1
      Makefile.am
  2. 3 0
      configure.ac
  3. 4 1
      src/Makefile.am
  4. 2 2
      src/main.c
  5. 2 3
      src/org_lexer.l

+ 1 - 1
Makefile.am

@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src
+SUBDIRS = src tests
 dist_doc_DATA = README
 EXTRA_DIST = autogen.sh m4/gnulib-cache.m4

+ 3 - 0
configure.ac

@@ -1,12 +1,14 @@
 # Process this file with autoconf to produce a configure script.
 AC_INIT([org-merge-driver], [0.1], [youngar17@gmail.com])
 AC_CONFIG_AUX_DIR(config)
+PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
 AM_INIT_AUTOMAKE([-Wall -Werror gnu])
 
 AC_CONFIG_MACRO_DIR([m4])
 
 # Check for programs
 AC_PROG_CC   # c compiler
+AM_PROG_CC_C_O
 AM_PROG_LEX  # flex
 AC_PROG_YACC # bison
 
@@ -23,5 +25,6 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([
  Makefile
  src/Makefile
+ tests/Makefile
 ])
 AC_OUTPUT

+ 4 - 1
src/Makefile.am

@@ -1,8 +1,11 @@
 bin_PROGRAMS = org-merge-driver
 
 # Bison and Flex
-BUILT_SOURCES = org_parser.h
+BUILT_SOURCES = org_parser.h org_lexer.h
 AM_YFLAGS = -d
 AM_LFLAGS = 
 
 org_merge_driver_SOURCES = org_parser.y org_lexer.l main.c
+
+org_lexer.h: org_lexer.l
+	lex $^

+ 2 - 2
src/main.c

@@ -4,8 +4,8 @@
 #include "Parser.h"
 #include "Lexer.h"
 */
-#include "org_mode.tab.h"
-#include "org_lex.yy.h"
+#include "org_parser.h"
+#include "org_lexer.h"
 
 char *progname;
 //double yylval;

+ 2 - 3
src/org_lexer.l

@@ -9,9 +9,8 @@ int yywrap();
 /* extern int yylex (void); */
 extern void yyerror (char const  *);
 %}
-/*
-%option outfile="org_lex.yy.c" header-file="org_lex.yy.h"
-*/
+
+%option header-file="org_lexer.h"
 
 /* %option reentrant */
 /* %option bison-bridge */