about summary refs log tree commit diff
path: root/src
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
parent9d72bf8835f3012169aaa88ec608172d5a056b9e (diff)
* Support for srcdir != builddir (NIX-41).
Diffstat (limited to 'src')
-rw-r--r--src/boost/format/Makefile.am2
-rw-r--r--src/libexpr/Makefile.am17
-rw-r--r--src/libmain/Makefile.am3
-rw-r--r--src/libstore/Makefile.am10
-rw-r--r--src/libutil/Makefile.am2
-rw-r--r--src/nix-env/Makefile.am5
-rw-r--r--src/nix-hash/Makefile.am2
-rw-r--r--src/nix-instantiate/Makefile.am5
-rw-r--r--src/nix-log2xml/Makefile.am2
-rw-r--r--src/nix-store/Makefile.am3
10 files changed, 27 insertions, 24 deletions
diff --git a/src/boost/format/Makefile.am b/src/boost/format/Makefile.am
index f89656827705..eb4d7dee82d5 100644
--- a/src/boost/format/Makefile.am
+++ b/src/boost/format/Makefile.am
@@ -5,4 +5,4 @@ libformat_la_SOURCES = format_implementation.cc free_funcs.cc \
  format_fwd.hpp group.hpp internals.hpp internals_fwd.hpp \
  macros_default.hpp
 
-AM_CXXFLAGS = -Wall -I../..
+AM_CXXFLAGS = -Wall -I$(srcdir)/../..
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 =
diff --git a/src/libmain/Makefile.am b/src/libmain/Makefile.am
index 505c9f686713..5b90297fe189 100644
--- a/src/libmain/Makefile.am
+++ b/src/libmain/Makefile.am
@@ -9,4 +9,5 @@ AM_CXXFLAGS = \
  -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
  -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
  -DNIX_VERSION=\"$(VERSION)\" \
- -I.. ${aterm_include} -I../libutil -I../libstore
+ -I$(srcdir)/.. ${aterm_include} -I$(srcdir)/../libutil \
+ -I$(srcdir)/../libstore
diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am
index 384f99b9ff28..c79830d8ae97 100644
--- a/src/libstore/Makefile.am
+++ b/src/libstore/Makefile.am
@@ -6,14 +6,14 @@ libstore_la_SOURCES = \
  misc.cc misc.hh \
  globals.cc globals.hh db.cc db.hh \
  references.cc references.hh pathlocks.cc pathlocks.hh \
- gc.cc gc.hh derivations-ast.hh
+ gc.cc gc.hh 
+
+BUILT_SOURCES = derivations-ast.cc derivations-ast.hh
 
 EXTRA_DIST = derivations-ast.def derivations-ast.cc
 
 AM_CXXFLAGS = -Wall \
- -I.. ${bdb_include} ${aterm_include} -I../libutil
+ -I$(srcdir)/.. ${bdb_include} ${aterm_include} -I$(srcdir)/../libutil
 
 derivations-ast.cc derivations-ast.hh: ../aterm-helper.pl derivations-ast.def
-	$(perl) ../aterm-helper.pl derivations-ast.hh derivations-ast.cc < derivations-ast.def
-
-derivations.cc store.cc: derivations-ast.hh
\ No newline at end of file
+	$(perl) $(srcdir)/../aterm-helper.pl derivations-ast.hh derivations-ast.cc < $(srcdir)/derivations-ast.def
diff --git a/src/libutil/Makefile.am b/src/libutil/Makefile.am
index e10477deb706..8fab0c5b0555 100644
--- a/src/libutil/Makefile.am
+++ b/src/libutil/Makefile.am
@@ -9,4 +9,4 @@ libutil_la_SOURCES += \
  md5.c md5.h sha1.c sha1.h sha256.c sha256.h md32_common.h
 endif
 
-AM_CXXFLAGS = -Wall -I.. ${aterm_include}
+AM_CXXFLAGS = -Wall -I$(srcdir)/.. ${aterm_include}
diff --git a/src/nix-env/Makefile.am b/src/nix-env/Makefile.am
index 02df3057a967..5511b2c8edd1 100644
--- a/src/nix-env/Makefile.am
+++ b/src/nix-env/Makefile.am
@@ -12,5 +12,6 @@ main.o: help.txt.hh
 	../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1)
 
 AM_CXXFLAGS = \
- -I.. ${bdb_include} ${aterm_include} -I../libutil -I../libstore \
- -I../libexpr -I../libmain
+ -I$(srcdir)/.. ${bdb_include} ${aterm_include} \
+ -I$(srcdir)/../libutil -I$(srcdir)/../libstore \
+ -I$(srcdir)/../libexpr -I$(srcdir)/../libmain -I../libexpr
diff --git a/src/nix-hash/Makefile.am b/src/nix-hash/Makefile.am
index 571b6157c004..1c7eee332329 100644
--- a/src/nix-hash/Makefile.am
+++ b/src/nix-hash/Makefile.am
@@ -10,4 +10,4 @@ nix-hash.o: help.txt.hh
 	../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1)
 
 AM_CXXFLAGS = \
- -I.. -I../../externals/inst/include -I../libutil -I../libstore -I../libmain
+ -I$(srcdir)/.. -I$(srcdir)/../libutil -I$(srcdir)/../libstore -I$(srcdir)/../libmain
diff --git a/src/nix-instantiate/Makefile.am b/src/nix-instantiate/Makefile.am
index 23f4fbf567a9..d1a87986f53d 100644
--- a/src/nix-instantiate/Makefile.am
+++ b/src/nix-instantiate/Makefile.am
@@ -11,5 +11,6 @@ main.o: help.txt.hh
 	../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1)
 
 AM_CXXFLAGS = \
- -I.. ${bdb_include} ${aterm_include} -I../libutil -I../libstore \
- -I../libexpr -I../libmain
+ ${bdb_include} ${aterm_include} \
+ -I$(srcdir)/.. -I$(srcdir)/../libutil -I$(srcdir)/../libstore \
+ -I$(srcdir)/../libexpr -I$(srcdir)/../libmain -I../libexpr
diff --git a/src/nix-log2xml/Makefile.am b/src/nix-log2xml/Makefile.am
index 4b6c76c24355..c538fda08014 100644
--- a/src/nix-log2xml/Makefile.am
+++ b/src/nix-log2xml/Makefile.am
@@ -8,7 +8,7 @@ nix_log2xml_SOURCES = log2xml.cc
 %.html: %.xml mark-errors.xsl log2html.xsl
 	$(xsltproc) mark-errors.xsl $< | $(xsltproc) log2html.xsl - > $@
 
-LOG2HTML = mark-errors.xsl log2html.xsl treebits.js
+LOG2HTML = $(srcdir)/mark-errors.xsl $(srcdir)/log2html.xsl $(srcdir)/treebits.js
 
 EXTRA_DIST = $(LOG2HTML)
 
diff --git a/src/nix-store/Makefile.am b/src/nix-store/Makefile.am
index 5cfa52e5e010..83fa24fca159 100644
--- a/src/nix-store/Makefile.am
+++ b/src/nix-store/Makefile.am
@@ -10,4 +10,5 @@ main.o: help.txt.hh
 	../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1)
 
 AM_CXXFLAGS = \
- -I.. ${bdb_include} $(aterm_include) -I../libutil -I../libstore -I../libmain
+ -I$(srcdir)/.. ${bdb_include} $(aterm_include) -I$(srcdir)/../libutil \
+ -I$(srcdir)/../libstore -I$(srcdir)/../libmain