diff --git a/Makefile b/Makefile index 85a2dc8e..b0a3e27a 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,10 @@ SUBS = \ perl/Makefile \ scripts/Makefile \ corepkgs/Makefile \ - tests/Makefile + tests/Makefile \ GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr +include Makefile.config + include mk/lib.mk diff --git a/perl/Makefile b/perl/Makefile index a0788e2a..8171d194 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -20,7 +20,7 @@ ifeq ($(perlbindings), yes) Store_DIR := $(d)/lib/Nix - Store_SOURCES = Store.cc + Store_SOURCES := $(Store_DIR)/Store.cc Store_LIBS = libstore diff --git a/src/boost/Makefile.am b/src/boost/Makefile.am deleted file mode 100644 index 8b5aa25f..00000000 --- a/src/boost/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS = format - -nobase_pkginclude_HEADERS = assert.hpp checked_delete.hpp format.hpp \ - shared_ptr.hpp weak_ptr.hpp throw_exception.hpp \ - enable_shared_from_this.hpp \ - detail/shared_count.hpp detail/workaround.hpp - -pkgincludedir = ${includedir}/nix/boost diff --git a/src/boost/format/Makefile b/src/boost/format/Makefile index b60a2ea4..17897fa5 100644 --- a/src/boost/format/Makefile +++ b/src/boost/format/Makefile @@ -4,4 +4,4 @@ libformat_NAME = libnixformat libformat_DIR := $(d) -libformat_SOURCES = format_implementation.cc free_funcs.cc parsing.cc +libformat_SOURCES := $(wildcard $(d)/*.cc) diff --git a/src/bsdiff-4.3/Makefile b/src/bsdiff-4.3/Makefile index c0d74e0c..aca1ac11 100644 --- a/src/bsdiff-4.3/Makefile +++ b/src/bsdiff-4.3/Makefile @@ -1,12 +1,12 @@ PROGRAMS += bsdiff bspatch bsdiff_DIR := $(d) -bsdiff_SOURCES = bsdiff.c +bsdiff_SOURCES := $(d)/bsdiff.c bsdiff_LDFLAGS = -lbz2 $(bsddiff_compat_include) bsdiff_INSTALL_DIR = $(libexecdir)/nix bspatch_DIR := $(d) -bspatch_SOURCES = bspatch.c +bspatch_SOURCES := $(d)/bspatch.c bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) bspatch_INSTALL_DIR = $(libexecdir)/nix diff --git a/src/libexpr/Makefile b/src/libexpr/Makefile index c6ed7d14..de276aa6 100644 --- a/src/libexpr/Makefile +++ b/src/libexpr/Makefile @@ -4,10 +4,7 @@ libexpr_NAME = libnixexpr libexpr_DIR := $(d) -libexpr_SOURCES = \ - nixexpr.cc eval.cc primops.cc lexer-tab.cc parser-tab.cc \ - get-drvs.cc attr-path.cc value-to-xml.cc value-to-json.cc \ - common-opts.cc names.cc +libexpr_SOURCES := $(wildcard $(d)/*.cc) $(d)/lexer-tab.cc $(d)/parser-tab.cc libexpr_LIBS = libutil libstore libformat diff --git a/src/libmain/Makefile b/src/libmain/Makefile index 7312b8d2..0efeee53 100644 --- a/src/libmain/Makefile +++ b/src/libmain/Makefile @@ -4,7 +4,7 @@ libmain_NAME = libnixmain libmain_DIR := $(d) -libmain_SOURCES = shared.cc stack.cc +libmain_SOURCES := $(wildcard $(d)/*.cc) libmain_LIBS = libstore libutil libformat diff --git a/src/libstore/Makefile b/src/libstore/Makefile index eaba1005..83c5d8ed 100644 --- a/src/libstore/Makefile +++ b/src/libstore/Makefile @@ -4,9 +4,7 @@ libstore_NAME = libnixstore libstore_DIR := $(d) -libstore_SOURCES = \ - store-api.cc local-store.cc remote-store.cc derivations.cc build.cc misc.cc \ - globals.cc references.cc pathlocks.cc gc.cc optimise-store.cc +libstore_SOURCES := $(wildcard $(d)/*.cc) libstore_LIBS = libutil libformat diff --git a/src/libutil/Makefile b/src/libutil/Makefile index b604c007..83bd05f2 100644 --- a/src/libutil/Makefile +++ b/src/libutil/Makefile @@ -4,12 +4,12 @@ libutil_NAME = libnixutil libutil_DIR := $(d) -libutil_SOURCES = util.cc hash.cc serialise.cc archive.cc xml-writer.cc affinity.cc +libutil_SOURCES := $(wildcard $(d)/*.cc) ifeq ($(HAVE_OPENSSL), 1) libutil_LDFLAGS = $(OPENSSL_LIBS) else - libutil_SOURCES += md5.c sha1.c sha256.c + libutil_SOURCES += $(d)/md5.c $(d)/sha1.c $(d)/sha256.c endif libutil_LIBS = libformat diff --git a/src/nix-daemon/Makefile b/src/nix-daemon/Makefile index 2a8a7d92..f6bc9ea3 100644 --- a/src/nix-daemon/Makefile +++ b/src/nix-daemon/Makefile @@ -2,6 +2,6 @@ PROGRAMS += nix-daemon nix-daemon_DIR := $(d) -nix-daemon_SOURCES = nix-daemon.cc +nix-daemon_SOURCES := $(d)/nix-daemon.cc nix-daemon_LIBS = libmain libstore libutil libformat diff --git a/src/nix-env/Makefile b/src/nix-env/Makefile index 04545231..5a38d2fb 100644 --- a/src/nix-env/Makefile +++ b/src/nix-env/Makefile @@ -2,6 +2,6 @@ PROGRAMS += nix-env nix-env_DIR := $(d) -nix-env_SOURCES = nix-env.cc profiles.cc user-env.cc +nix-env_SOURCES := $(wildcard $(d)/*.cc) nix-env_LIBS = libexpr libmain libstore libutil libformat diff --git a/src/nix-hash/Makefile b/src/nix-hash/Makefile index 462cd78d..062e4d13 100644 --- a/src/nix-hash/Makefile +++ b/src/nix-hash/Makefile @@ -2,6 +2,6 @@ PROGRAMS += nix-hash nix-hash_DIR := $(d) -nix-hash_SOURCES = nix-hash.cc +nix-hash_SOURCES := $(d)/nix-hash.cc nix-hash_LIBS = libmain libstore libutil libformat diff --git a/src/nix-instantiate/Makefile b/src/nix-instantiate/Makefile index 9c4cfec2..daa741eb 100644 --- a/src/nix-instantiate/Makefile +++ b/src/nix-instantiate/Makefile @@ -2,6 +2,6 @@ PROGRAMS += nix-instantiate nix-instantiate_DIR := $(d) -nix-instantiate_SOURCES = nix-instantiate.cc +nix-instantiate_SOURCES := $(d)/nix-instantiate.cc nix-instantiate_LIBS = libexpr libmain libstore libutil libformat diff --git a/src/nix-log2xml/Makefile b/src/nix-log2xml/Makefile index 8b02dca7..8467d197 100644 --- a/src/nix-log2xml/Makefile +++ b/src/nix-log2xml/Makefile @@ -2,7 +2,7 @@ PROGRAMS += nix-log2xml nix-log2xml_DIR := $(d) -nix-log2xml_SOURCES = log2xml.cc +nix-log2xml_SOURCES := $(d)/log2xml.cc $(foreach file, mark-errors.xsl log2html.xsl treebits.js, \ $(eval $(call install-data-in, $(d)/$(file), $(datadir)/nix/log2html))) diff --git a/src/nix-store/Makefile b/src/nix-store/Makefile index 10551387..edd111b4 100644 --- a/src/nix-store/Makefile +++ b/src/nix-store/Makefile @@ -2,7 +2,7 @@ PROGRAMS += nix-store nix-store_DIR := $(d) -nix-store_SOURCES = nix-store.cc dotgraph.cc xmlgraph.cc +nix-store_SOURCES := $(wildcard $(d)/*.cc) nix-store_LIBS = libmain libstore libutil libformat