about summary refs log tree commit diff
path: root/src/libexpr/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/Makefile.am')
-rw-r--r--src/libexpr/Makefile.am17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libexpr/Makefile.am b/src/libexpr/Makefile.am
index ad95dff1d648..1e77420d51ed 100644
--- a/src/libexpr/Makefile.am
+++ b/src/libexpr/Makefile.am
@@ -3,34 +3,33 @@ lib_LTLIBRARIES = libexpr.la
 libexpr_la_SOURCES = nixexpr.cc nixexpr.hh parser.cc parser.hh \
  eval.cc eval.hh primops.cc \
  lexer-tab.c lexer-tab.h parser-tab.c parser-tab.h \
- nixexpr-ast.hh \
  get-drvs.cc get-drvs.hh
 
+BUILT_SOURCES = nixexpr-ast.cc nixexpr-ast.hh \
+ parser-tab.h lexer-tab.h parser-tab.c lexer-tab.c
+
 EXTRA_DIST = lexer.l parser.y nixexpr-ast.def nixexpr-ast.cc
 
 AM_CXXFLAGS = \
- -I.. ${bdb_include} ${aterm_include} -I../libutil -I../libstore
+ -I$(srcdir)/.. ${bdb_include} ${aterm_include} \
+ -I$(srcdir)/../libutil -I$(srcdir)/../libstore
 AM_CFLAGS = \
  ${aterm_include}
 
 
 # Parser generation.
 
-parser.cc: parser-tab.h lexer-tab.h
-
 parser-tab.c parser-tab.h: parser.y
-	$(bison) -v -o parser-tab.c parser.y -d
+	$(bison) -v -o parser-tab.c $(srcdir)/parser.y -d
 
 lexer-tab.c lexer-tab.h: lexer.l
-	$(flex) --outfile lexer-tab.c --header-file=lexer-tab.h lexer.l 
+	$(flex) --outfile lexer-tab.c --header-file=lexer-tab.h $(srcdir)/lexer.l 
 
 
 # ATerm helper function generation.
 
 nixexpr-ast.cc nixexpr-ast.hh: ../aterm-helper.pl nixexpr-ast.def
-	$(perl) ../aterm-helper.pl nixexpr-ast.hh nixexpr-ast.cc < nixexpr-ast.def
-
-nixexpr.cc nixexpr.hh: nixexpr-ast.hh
+	$(perl) $(srcdir)/../aterm-helper.pl nixexpr-ast.hh nixexpr-ast.cc < $(srcdir)/nixexpr-ast.def
 
 
 CLEANFILES =