about summary refs log tree commit diff
path: root/src/libexpr/Makefile.am
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-05-12T11·47+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-05-12T11·47+0000
commitb5988004d64d6c533e8bb09732a6f7cd4fb1194f (patch)
treeb8768d77c2a3a3557436e22997c3128ed069fda7 /src/libexpr/Makefile.am
parent9d72bf8835f3012169aaa88ec608172d5a056b9e (diff)
* Support for srcdir != builddir (NIX-41).
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 =