about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-20T10·05+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-20T10·05+0000
commitc62433751d5fce8c25a802989c50fee993f39c2d (patch)
tree3be155a9a5f4e516450582c49ded9fc61173e2be /src
parent53e376d836133a660223198c7bb8308fb912375e (diff)
* Finished refactoring the tree.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am56
-rw-r--r--src/boost/format/Makefile.am2
-rw-r--r--src/fix/Makefile.am8
-rw-r--r--src/fix/fix.cc8
-rw-r--r--src/libmain/Makefile.am12
-rw-r--r--src/libnix/Makefile.am9
-rw-r--r--src/nix-hash/Makefile.am8
-rw-r--r--src/nix/Makefile.am27
8 files changed, 71 insertions, 59 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 216d664e880e..200ea45fb03f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,55 +1 @@
-bin_PROGRAMS = nix nix-hash fix
-check_PROGRAMS = test
-
-
-AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../externals/inst/include $(CXXFLAGS)
-LDADD = -L../externals/inst/lib -ldb_cxx -lATerm -L../boost/format -lformat
-
-nix_SOURCES = nix.cc dotgraph.cc
-nix_LDADD = libshared.a libnix.a $(LDADD)
-
-nix_hash_SOURCES = nix-hash.cc
-nix_hash_LDADD = libshared.a libnix.a $(LDADD)
-
-fix_SOURCES = fix.cc
-fix_LDADD = libshared.a libnix.a $(LDADD)
-
-TESTS = test
-
-test_SOURCES = test.cc
-test_LDADD = libshared.a libnix.a $(LDADD)
-
-
-noinst_LIBRARIES = libnix.a libshared.a
-
-libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
- store.cc expr.cc normalise.cc exec.cc \
- globals.cc db.cc references.cc pathlocks.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\" \
- $(AM_CXXFLAGS)
-
-nix.o: nix-help.txt.hh
-
-%.hh: %
-	echo -n '"' > $@
-	sed 's|\(.*\)|\1\\n\\|' < $< >> $@
-	echo '"' >> $@
-
-install-data-local:
-	$(INSTALL) -d $(localstatedir)/nix
-	$(INSTALL) -d $(localstatedir)/nix/db
-	$(INSTALL) -d $(localstatedir)/nix/links
-	rm -f $(prefix)/current
-	ln -sf $(localstatedir)/nix/links/current $(prefix)/current
-	$(INSTALL) -d $(localstatedir)/log/nix
-	$(INSTALL) -d $(prefix)/store
-	$(bindir)/nix --init
-
-EXTRA_DIST = *.hh *.h test-builder-*.sh
+SUBDIRS = boost libnix libmain nix nix-hash fix
diff --git a/src/boost/format/Makefile.am b/src/boost/format/Makefile.am
index 5badba27cf6d..bae92c198287 100644
--- a/src/boost/format/Makefile.am
+++ b/src/boost/format/Makefile.am
@@ -2,5 +2,7 @@ noinst_LIBRARIES = libformat.a
 
 libformat_a_SOURCES = format_implementation.cc free_funcs.cc parsing.cc
 
+AM_CXXFLAGS = -Wall -I../..
+
 EXTRA_DIST = exceptions.hpp feed_args.hpp format_class.hpp format_fwd.hpp \
  group.hpp internals.hpp internals_fwd.hpp macros_default.hpp
diff --git a/src/fix/Makefile.am b/src/fix/Makefile.am
new file mode 100644
index 000000000000..4786db54c3c0
--- /dev/null
+++ b/src/fix/Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = fix
+
+fix_SOURCES = fix.cc
+fix_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
+ -L../../externals/inst/lib -ldb_cxx -lATerm
+
+AM_CXXFLAGS = \
+ -I.. -I../../externals/inst/include -I../libnix -I../libmain
diff --git a/src/fix/fix.cc b/src/fix/fix.cc
index c1f9c1ad68d0..9a8ff1513042 100644
--- a/src/fix/fix.cc
+++ b/src/fix/fix.cc
@@ -249,7 +249,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
 
     /* Platform constant. */
     if (ATmatch(e, "Platform")) {
-        return ATmake("<str>", SYSTEM);
+        return ATmake("<str>", thisSystem.c_str());
     }
 
     /* Fix inclusion. */
@@ -284,7 +284,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
 
         /* Evaluate the bindings and put them in a map. */
         map<string, ATerm> bndMap;
-        bndMap["platform"] = ATmake("<str>", SYSTEM);
+        bndMap["platform"] = ATmake("<str>", thisSystem.c_str());
         while (!ATisEmpty(bnds)) {
             ATerm bnd = ATgetFirst(bnds);
             if (!ATmatch(bnd, "(<str>, <term>)", &s1, &e1))
@@ -297,7 +297,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
            expression. */
         NixExpr ne;
         ne.type = NixExpr::neDerivation;
-        ne.derivation.platform = SYSTEM;
+        ne.derivation.platform = thisSystem;
         string name;
         Path outPath;
         Hash outHash;
@@ -320,7 +320,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
                     ne.derivation.args.push_back(processBinding(state, arg, ne));
                     args = ATgetNext(args);
                 }
-            } 
+            }
 
             else {
                 string s = processBinding(state, value, ne);
diff --git a/src/libmain/Makefile.am b/src/libmain/Makefile.am
new file mode 100644
index 000000000000..aebb1286e786
--- /dev/null
+++ b/src/libmain/Makefile.am
@@ -0,0 +1,12 @@
+noinst_LIBRARIES = libmain.a
+
+libmain_a_SOURCES = shared.cc
+
+AM_CXXFLAGS = \
+ -DNIX_STORE_DIR=\"$(prefix)/store\" \
+ -DNIX_DATA_DIR=\"$(datadir)\" \
+ -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
+ -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
+ -I.. -I../../externals/inst/include -I../libnix
+
+EXTRA_DIST = *.hh
diff --git a/src/libnix/Makefile.am b/src/libnix/Makefile.am
new file mode 100644
index 000000000000..b890ba8c0548
--- /dev/null
+++ b/src/libnix/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libnix.a
+
+libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
+ store.cc expr.cc normalise.cc exec.cc \
+ globals.cc db.cc references.cc pathlocks.cc
+
+AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../../externals/inst/include
+
+EXTRA_DIST = *.hh *.h test-builder-*.sh
diff --git a/src/nix-hash/Makefile.am b/src/nix-hash/Makefile.am
new file mode 100644
index 000000000000..7fb428a29f13
--- /dev/null
+++ b/src/nix-hash/Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = nix-hash
+
+nix_hash_SOURCES = nix-hash.cc
+nix_hash_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
+ -L../../externals/inst/lib -ldb_cxx -lATerm
+
+AM_CXXFLAGS = \
+ -I.. -I../../externals/inst/include -I../libnix -I../libmain
diff --git a/src/nix/Makefile.am b/src/nix/Makefile.am
new file mode 100644
index 000000000000..37415976b3d7
--- /dev/null
+++ b/src/nix/Makefile.am
@@ -0,0 +1,27 @@
+bin_PROGRAMS = nix
+
+nix_SOURCES = nix.cc dotgraph.cc
+nix_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
+ -L../../externals/inst/lib -ldb_cxx -lATerm
+
+nix.o: nix-help.txt.hh
+
+%.hh: %
+	echo -n '"' > $@
+	sed 's|\(.*\)|\1\\n\\|' < $< >> $@
+	echo '"' >> $@
+
+AM_CXXFLAGS = \
+ -I.. -I../../externals/inst/include -I../libnix -I../libmain
+
+install-data-local:
+	$(INSTALL) -d $(localstatedir)/nix
+	$(INSTALL) -d $(localstatedir)/nix/db
+	$(INSTALL) -d $(localstatedir)/nix/links
+	rm -f $(prefix)/current
+	ln -sf $(localstatedir)/nix/links/current $(prefix)/current
+	$(INSTALL) -d $(localstatedir)/log/nix
+	$(INSTALL) -d $(prefix)/store
+	$(bindir)/nix --init
+
+EXTRA_DIST = *.hh