about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4b21f12b3a26..d8ec50f0b64e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,25 +3,33 @@ check_PROGRAMS = test
 
 AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I..
 
-nix_SOURCES = nix.cc shared.cc
-nix_LDADD = libnix.a -ldb_cxx-4 -lATerm
+nix_SOURCES = nix.cc
+nix_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-nix_hash_SOURCES = nix-hash.cc shared.cc
-nix_hash_LDADD = libnix.a -ldb_cxx-4 -lATerm
+nix_hash_SOURCES = nix-hash.cc
+nix_hash_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-fix_SOURCES = fix.cc shared.cc
-fix_LDADD = libnix.a -ldb_cxx-4 -lATerm
+fix_SOURCES = fix.cc
+fix_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
 TESTS = test
 
-test_SOURCES = test.cc shared.cc
-test_LDADD = libnix.a -ldb_cxx-4 -lATerm
+test_SOURCES = test.cc
+test_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-noinst_LIBRARIES = libnix.a
+noinst_LIBRARIES = libnix.a libshared.a
 
 libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
  fstate.cc store.cc globals.cc db.cc
 
+libshared_a_SOURCES = shared.cc
+
+libshared_a_CXXFLAGS = \
+ -DNIX_STORE_DIR=\"$(prefix)/store\" \
+ -DNIX_DATA_DIR=\"$(datadir)\" \
+ -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
+ -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\"
+
 install-data-local:
 	$(INSTALL) -d $(localstatedir)/nix
 	$(INSTALL) -d $(localstatedir)/nix/links