From 7ce0e05ad875657a0fec10e192454b837146e190 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Nov 2013 15:25:13 +0000 Subject: Rename Makefile.new -> Makefile --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..652085a78165 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +SUBS = \ + src/boost/format/Makefile \ + src/libutil/Makefile \ + src/libstore/Makefile \ + src/libmain/Makefile \ + src/libexpr/Makefile \ + src/nix-hash/Makefile \ + src/nix-store/Makefile \ + src/nix-instantiate/Makefile \ + src/nix-env/Makefile \ + src/nix-daemon/Makefile \ + src/nix-log2xml/Makefile \ + src/bsdiff-4.3/Makefile \ + scripts/Makefile \ + corepkgs/Makefile + +GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr + +include mk/lib.mk -- cgit 1.4.1 From 9285f0aa2b44427afef7c50f0efae8f74307a7a5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Nov 2013 16:38:33 +0000 Subject: Add a Makefile for the Perl stuff --- Makefile | 1 + Makefile.config.in | 3 +++ mk/lib.mk | 2 +- mk/libraries.mk | 17 ++++++++++++----- perl/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ perl/lib/Nix/Config.pm.in | 2 +- 6 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 perl/Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile index 652085a78165..6abce9372b2c 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ SUBS = \ src/nix-daemon/Makefile \ src/nix-log2xml/Makefile \ src/bsdiff-4.3/Makefile \ + perl/Makefile \ scripts/Makefile \ corepkgs/Makefile diff --git a/Makefile.config.in b/Makefile.config.in index b9d9bd1c46f4..65080c88f71a 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -16,6 +16,9 @@ exec_prefix = @exec_prefix@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +perl = @perl@ +perlbindings = @perlbindings@ +perllibdir = @perllibdir@ pkglibdir = $(libdir)/$(PACKAGE_NAME) prefix = @prefix@ storedir = @storedir@ diff --git a/mk/lib.mk b/mk/lib.mk index a1634bc002f9..107a5af3f75e 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -58,4 +58,4 @@ $(foreach script, $(noinst_SCRIPTS), $(eval programs_list += $(script))) $(foreach template, $(template_files), $(eval $(call instantiate-template,$(template)))) -all: $(programs_list) +all: $(programs_list) $(libs_list) diff --git a/mk/libraries.mk b/mk/libraries.mk index 633bfdba812a..58c67063be5e 100644 --- a/mk/libraries.mk +++ b/mk/libraries.mk @@ -22,11 +22,14 @@ libs_list := # - $(1)_LDFLAGS_PROPAGATED: additional linker flags, also propagated # to the linking of programs/libraries that use this library. # +# - $(1)_FORCE_INSTALL: if defined, the library will be installed even +# if it's not needed (i.e. dynamically linked) by a program. +# +# - $(1)_INSTALL_DIR: the directory where the library will be +# installed. Defaults to $(libdir). +# # - BUILD_SHARED_LIBS: if equal to ‘1’, a dynamic library will be # built, otherwise a static library. -# -# - libdir: the directory where the library will be installed (if -# required). define build-library = $(1)_NAME ?= $(1) _d := $$(strip $$($(1)_DIR)) @@ -34,6 +37,8 @@ define build-library = $(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs))) _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH)) + $(1)_INSTALL_DIR ?= $$(libdir) + $(1)_LDFLAGS_USE := $(1)_LDFLAGS_USE_INSTALLED := @@ -50,8 +55,6 @@ define build-library = $(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) - $(1)_INSTALL_DIR := $$(libdir) - $(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$$($(1)_NAME).so _libs_final := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_INSTALL_PATH)) @@ -63,6 +66,10 @@ define build-library = $(1)_LDFLAGS_USE_INSTALLED += -L$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) + ifdef $(1)_FORCE_INSTALL + install: $$($(1)_INSTALL_PATH) + endif + else $(1)_PATH := $$(_d)/$$($(1)_NAME).a diff --git a/perl/Makefile b/perl/Makefile new file mode 100644 index 000000000000..a0788e2a2812 --- /dev/null +++ b/perl/Makefile @@ -0,0 +1,41 @@ +nix_perl_sources := \ + $(d)/lib/Nix/Store.pm \ + $(d)/lib/Nix/Manifest.pm \ + $(d)/lib/Nix/GeneratePatches.pm \ + $(d)/lib/Nix/SSH.pm \ + $(d)/lib/Nix/CopyClosure.pm \ + $(d)/lib/Nix/Config.pm.in \ + $(d)/lib/Nix/Utils.pm + +nix_perl_modules := $(nix_perl_sources:.in=) + +$(foreach x, $(nix_perl_modules), $(eval $(call install-data-in, $(x), $(perllibdir)/Nix))) + +ifeq ($(perlbindings), yes) + + $(d)/lib/Nix/Store.cc: $(d)/lib/Nix/Store.xs + xsubpp $^ -output $@ + + LIBS += Store + + Store_DIR := $(d)/lib/Nix + + Store_SOURCES = Store.cc + + Store_LIBS = libstore + + Store_CXXFLAGS = \ + -I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \ + -D_FILE_OFFSET_BITS=64 + + Store_ALLOW_UNDEFINED = 1 + + Store_FORCE_INSTALL = 1 + + Store_INSTALL_DIR = $(perllibdir)/auto/Nix/Store + +endif + +clean_files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc + +dist_files += $(nix_perl_sources) diff --git a/perl/lib/Nix/Config.pm.in b/perl/lib/Nix/Config.pm.in index 8c902ab6edc5..ee9d865ca344 100644 --- a/perl/lib/Nix/Config.pm.in +++ b/perl/lib/Nix/Config.pm.in @@ -1,6 +1,6 @@ package Nix::Config; -$version = "@version@"; +$version = "@PACKAGE_VERSION@"; $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@"; $libexecDir = $ENV{"NIX_LIBEXEC_DIR"} || "@libexecdir@"; -- cgit 1.4.1 From 0202ce6b94f287f70a6723473c73a4c7f135dae4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Nov 2013 18:47:03 +0100 Subject: Add support for ‘make installcheck’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 9 --------- Makefile | 3 ++- Makefile.config.in | 2 +- corepkgs/config.nix.in | 2 +- mk/lib.mk | 6 ++++++ scripts/nix-reduce-build.in | 2 +- src/nix-log2xml/Makefile | 3 +++ tests/Makefile | 21 +++++++++++++++++++++ tests/common.sh.in | 8 ++++---- tests/config.nix | 20 ++++++++++++++++++++ tests/config.nix.in | 18 ------------------ tests/parallel.sh | 12 ++++++------ 12 files changed, 65 insertions(+), 41 deletions(-) create mode 100644 tests/Makefile create mode 100644 tests/config.nix delete mode 100644 tests/config.nix.in (limited to 'Makefile') diff --git a/.gitignore b/.gitignore index fafe8a17a461..42c7be2b7ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -85,10 +85,6 @@ Makefile.config # /src/nix-log2xml/ /src/nix-log2xml/nix-log2xml -/src/nix-log2xml/test*.* -/src/nix-log2xml/*.log -/src/nix-log2xml/*.xml -/src/nix-log2xml/*.html # /src/nix-store/ /src/nix-store/nix-store @@ -98,7 +94,6 @@ Makefile.config # /tests/ /tests/test-tmp -/tests/config.nix /tests/common.sh /tests/dummy /tests/result* @@ -111,11 +106,7 @@ Makefile.config /perl/lib/Nix/Config.pm /perl/lib/Nix/Store.cc -.deps -.libs *.a -*.lo -*.la *.o *.so *.dep diff --git a/Makefile b/Makefile index 6abce9372b2c..85a2dc8e521b 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,8 @@ SUBS = \ src/bsdiff-4.3/Makefile \ perl/Makefile \ scripts/Makefile \ - corepkgs/Makefile + corepkgs/Makefile \ + tests/Makefile GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr diff --git a/Makefile.config.in b/Makefile.config.in index 65080c88f71a..130da2625618 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,5 +1,4 @@ BDW_GC_LIBS = @BDW_GC_LIBS@ -BUILD_DEBUG = 1 CC = @CC@ CFLAGS = @CFLAGS@ CXX = @CXX@ @@ -8,6 +7,7 @@ HAVE_OPENSSL = @HAVE_OPENSSL@ OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +bash = @bash@ bindir = @bindir@ bsddiff_compat_include = @bsddiff_compat_include@ datadir = @datadir@ diff --git a/corepkgs/config.nix.in b/corepkgs/config.nix.in index 3819dc96c164..a5ec83b9ea0c 100644 --- a/corepkgs/config.nix.in +++ b/corepkgs/config.nix.in @@ -4,7 +4,7 @@ let if val != "" then val else def; in { perl = "@perl@"; - shell = "@shell@"; + shell = "@bash@"; coreutils = "@coreutils@"; bzip2 = "@bzip2@"; gzip = "@gzip@"; diff --git a/mk/lib.mk b/mk/lib.mk index 107a5af3f75e..60b6815e9e2e 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -17,6 +17,8 @@ noinst_SCRIPTS := # Pass -fPIC if we're building dynamic libraries. +BUILD_SHARED_LIBS = 1 + ifeq ($(BUILD_SHARED_LIBS), 1) GLOBAL_CFLAGS += -fPIC GLOBAL_CXXFLAGS += -fPIC @@ -25,6 +27,8 @@ endif # Pass -g if we want debug info. +BUILD_DEBUG = 1 + ifeq ($(BUILD_DEBUG), 1) GLOBAL_CFLAGS += -g GLOBAL_CXXFLAGS += -g @@ -38,6 +42,7 @@ include mk/libraries.mk include mk/programs.mk include mk/patterns.mk include mk/templates.mk +include mk/tests.mk # Include all sub-Makefiles. @@ -56,6 +61,7 @@ $(foreach script, $(bin_SCRIPTS), $(eval $(call install-program-in,$(script),$(b $(foreach script, $(bin_SCRIPTS), $(eval programs_list += $(script))) $(foreach script, $(noinst_SCRIPTS), $(eval programs_list += $(script))) $(foreach template, $(template_files), $(eval $(call instantiate-template,$(template)))) +$(foreach test, $(INSTALL_TESTS), $(eval $(call run-install-test,$(test)))) all: $(programs_list) $(libs_list) diff --git a/scripts/nix-reduce-build.in b/scripts/nix-reduce-build.in index 0c33275d5eb0..50beb9d10b16 100755 --- a/scripts/nix-reduce-build.in +++ b/scripts/nix-reduce-build.in @@ -1,4 +1,4 @@ -#! @shell@ +#! @bash@ WORKING_DIRECTORY=$(mktemp -d "${TMPDIR:-/tmp}"/nix-reduce-build-XXXXXX); cd "$WORKING_DIRECTORY"; diff --git a/src/nix-log2xml/Makefile b/src/nix-log2xml/Makefile index a88f948671dc..8b02dca7ae21 100644 --- a/src/nix-log2xml/Makefile +++ b/src/nix-log2xml/Makefile @@ -3,3 +3,6 @@ PROGRAMS += nix-log2xml nix-log2xml_DIR := $(d) nix-log2xml_SOURCES = log2xml.cc + +$(foreach file, mark-errors.xsl log2html.xsl treebits.js, \ + $(eval $(call install-data-in, $(d)/$(file), $(datadir)/nix/log2html))) diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 000000000000..21ffd047f6f2 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,21 @@ +check: + @echo "Warning: Nix has no 'make check'. Please install Nix and run 'make installcheck' instead." + +nix_tests = \ + init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ + parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ + fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ + referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \ + gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \ + remote-store.sh export.sh export-graph.sh negative-caching.sh \ + binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \ + multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \ + binary-cache.sh nix-profile.sh + +INSTALL_TESTS += $(foreach x, $(nix_tests), tests/$(x)) + +TESTS_ENVIRONMENT = NIX_REMOTE= $(bash) -e + +clean_files += $(d)/common.sh + +installcheck: $(d)/common.sh diff --git a/tests/common.sh.in b/tests/common.sh.in index 2ae34603fcb5..633769ae2c1e 100644 --- a/tests/common.sh.in +++ b/tests/common.sh.in @@ -1,7 +1,7 @@ set -e datadir="@datadir@" -profiledir="@profiledir@" +profiledir="@sysconfdir@/profile.d" export TEST_ROOT=$(pwd)/test-tmp export NIX_STORE_DIR @@ -16,7 +16,7 @@ export NIX_STATE_DIR=$TEST_ROOT/var/nix export NIX_DB_DIR=$TEST_ROOT/db export NIX_CONF_DIR=$TEST_ROOT/etc export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests -export SHARED=$TEST_ROOT/shared +export _NIX_TEST_SHARED=$TEST_ROOT/shared export NIX_REMOTE=$NIX_REMOTE_ export PATH=@bindir@:$PATH @@ -26,9 +26,9 @@ export dot=@dot@ export xmllint="@xmllint@" export xmlflags="@xmlflags@" export xsltproc="@xsltproc@" -export SHELL="@shell@" +export SHELL="@bash@" -export version=@version@ +export version=@PACKAGE_VERSION@ export system=@system@ readLink() { diff --git a/tests/config.nix b/tests/config.nix new file mode 100644 index 000000000000..6244a15fa48a --- /dev/null +++ b/tests/config.nix @@ -0,0 +1,20 @@ +with import ; + +rec { + inherit shell; + + path = coreutils; + + system = builtins.currentSystem; + + shared = builtins.getEnv "_NIX_TEST_SHARED"; + + mkDerivation = args: + derivation ({ + inherit system; + builder = shell; + args = ["-e" args.builder]; + PATH = path; + } // removeAttrs args ["builder" "meta"]) + // { meta = args.meta or {}; }; +} diff --git a/tests/config.nix.in b/tests/config.nix.in deleted file mode 100644 index db3da145135c..000000000000 --- a/tests/config.nix.in +++ /dev/null @@ -1,18 +0,0 @@ -rec { - shell = "@shell@"; - - path = "@testPath@"; - - system = "@system@"; - - shared = "@extra1@"; - - mkDerivation = args: - derivation ({ - inherit system; - builder = shell; - args = ["-e" args.builder]; - PATH = path; - } // removeAttrs args ["builder" "meta"]) - // { meta = args.meta or {}; }; -} diff --git a/tests/parallel.sh b/tests/parallel.sh index 9b150263a59d..3b7bbe5a2251 100644 --- a/tests/parallel.sh +++ b/tests/parallel.sh @@ -6,7 +6,7 @@ echo "testing nix-build -j..." clearStore -rm -f $SHARED.cur $SHARED.max +rm -f $_NIX_TEST_SHARED.cur $_NIX_TEST_SHARED.max outPath=$(nix-build -j10000 parallel.nix --no-out-link) @@ -15,8 +15,8 @@ echo "output path is $outPath" text=$(cat "$outPath") if test "$text" != "abacade"; then exit 1; fi -if test "$(cat $SHARED.cur)" != 0; then fail "wrong current process count"; fi -if test "$(cat $SHARED.max)" != 3; then fail "not enough parallelism"; fi +if test "$(cat $_NIX_TEST_SHARED.cur)" != 0; then fail "wrong current process count"; fi +if test "$(cat $_NIX_TEST_SHARED.max)" != 3; then fail "not enough parallelism"; fi # Second, test that parallel invocations of nix-build perform builds @@ -25,7 +25,7 @@ echo "testing multiple nix-build -j1..." clearStore -rm -f $SHARED.cur $SHARED.max +rm -f $_NIX_TEST_SHARED.cur $_NIX_TEST_SHARED.max drvPath=$(nix-instantiate parallel.nix --argstr sleepTime 15) @@ -52,5 +52,5 @@ wait $pid2 || fail "instance 2 failed: $?" wait $pid3 || fail "instance 3 failed: $?" wait $pid4 || fail "instance 4 failed: $?" -if test "$(cat $SHARED.cur)" != 0; then fail "wrong current process count"; fi -if test "$(cat $SHARED.max)" != 3; then fail "not enough parallelism"; fi +if test "$(cat $_NIX_TEST_SHARED.cur)" != 0; then fail "wrong current process count"; fi +if test "$(cat $_NIX_TEST_SHARED.max)" != 3; then fail "not enough parallelism"; fi -- cgit 1.4.1 From b4c684e0f9c6890e13f9a5cc90b5e379b3d1f75d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 Jan 2014 16:53:47 +0100 Subject: Update Makefiles --- Makefile | 4 +++- perl/Makefile | 2 +- src/boost/Makefile.am | 8 -------- src/boost/format/Makefile | 2 +- src/bsdiff-4.3/Makefile | 4 ++-- src/libexpr/Makefile | 5 +---- src/libmain/Makefile | 2 +- src/libstore/Makefile | 4 +--- src/libutil/Makefile | 4 ++-- src/nix-daemon/Makefile | 2 +- src/nix-env/Makefile | 2 +- src/nix-hash/Makefile | 2 +- src/nix-instantiate/Makefile | 2 +- src/nix-log2xml/Makefile | 2 +- src/nix-store/Makefile | 2 +- 15 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 src/boost/Makefile.am (limited to 'Makefile') diff --git a/Makefile b/Makefile index 85a2dc8e521b..b0a3e27aa197 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 a0788e2a2812..8171d1945a47 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 8b5aa25fb5bd..000000000000 --- 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 b60a2ea4fb62..17897fa59074 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 c0d74e0ca4fd..aca1ac116205 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 c6ed7d14b9bf..de276aa65296 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 7312b8d2cd26..0efeee531478 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 eaba1005f227..83c5d8ed49b7 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 b604c0078709..83bd05f281d6 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 2a8a7d92cd26..f6bc9ea31c92 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 04545231caf3..5a38d2fb76af 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 462cd78d8c26..062e4d13b29e 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 9c4cfec287d9..daa741eb7f08 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 8b02dca7ae21..8467d1973bda 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 105513872e81..edd111b42015 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 -- cgit 1.4.1 From e0234dfddc8343a6bca80ba6e6e93d083ce51a85 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Jan 2014 12:11:06 +0100 Subject: Rename Makefile -> local.mk --- Makefile | 32 ++++++++++++++++---------------- corepkgs/Makefile | 5 ----- corepkgs/local.mk | 5 +++++ perl/Makefile | 42 ------------------------------------------ perl/local.mk | 42 ++++++++++++++++++++++++++++++++++++++++++ scripts/Makefile | 39 --------------------------------------- scripts/local.mk | 39 +++++++++++++++++++++++++++++++++++++++ src/boost/format/Makefile | 7 ------- src/boost/format/local.mk | 7 +++++++ src/bsdiff-4.3/Makefile | 13 ------------- src/bsdiff-4.3/local.mk | 13 +++++++++++++ src/libexpr/Makefile | 20 -------------------- src/libexpr/local.mk | 20 ++++++++++++++++++++ src/libmain/Makefile | 11 ----------- src/libmain/local.mk | 11 +++++++++++ src/libstore/Makefile | 26 -------------------------- src/libstore/local.mk | 26 ++++++++++++++++++++++++++ src/libutil/Makefile | 15 --------------- src/libutil/local.mk | 15 +++++++++++++++ src/nix-daemon/Makefile | 9 --------- src/nix-daemon/local.mk | 9 +++++++++ src/nix-env/Makefile | 7 ------- src/nix-env/local.mk | 7 +++++++ src/nix-hash/Makefile | 7 ------- src/nix-hash/local.mk | 7 +++++++ src/nix-instantiate/Makefile | 7 ------- src/nix-instantiate/local.mk | 7 +++++++ src/nix-log2xml/Makefile | 8 -------- src/nix-log2xml/local.mk | 8 ++++++++ src/nix-store/Makefile | 9 --------- src/nix-store/local.mk | 9 +++++++++ tests/Makefile | 21 --------------------- tests/local.mk | 21 +++++++++++++++++++++ 33 files changed, 262 insertions(+), 262 deletions(-) delete mode 100644 corepkgs/Makefile create mode 100644 corepkgs/local.mk delete mode 100644 perl/Makefile create mode 100644 perl/local.mk delete mode 100644 scripts/Makefile create mode 100644 scripts/local.mk delete mode 100644 src/boost/format/Makefile create mode 100644 src/boost/format/local.mk delete mode 100644 src/bsdiff-4.3/Makefile create mode 100644 src/bsdiff-4.3/local.mk delete mode 100644 src/libexpr/Makefile create mode 100644 src/libexpr/local.mk delete mode 100644 src/libmain/Makefile create mode 100644 src/libmain/local.mk delete mode 100644 src/libstore/Makefile create mode 100644 src/libstore/local.mk delete mode 100644 src/libutil/Makefile create mode 100644 src/libutil/local.mk delete mode 100644 src/nix-daemon/Makefile create mode 100644 src/nix-daemon/local.mk delete mode 100644 src/nix-env/Makefile create mode 100644 src/nix-env/local.mk delete mode 100644 src/nix-hash/Makefile create mode 100644 src/nix-hash/local.mk delete mode 100644 src/nix-instantiate/Makefile create mode 100644 src/nix-instantiate/local.mk delete mode 100644 src/nix-log2xml/Makefile create mode 100644 src/nix-log2xml/local.mk delete mode 100644 src/nix-store/Makefile create mode 100644 src/nix-store/local.mk delete mode 100644 tests/Makefile create mode 100644 tests/local.mk (limited to 'Makefile') diff --git a/Makefile b/Makefile index b0a3e27aa197..b7ffc1b037ce 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ SUBS = \ - src/boost/format/Makefile \ - src/libutil/Makefile \ - src/libstore/Makefile \ - src/libmain/Makefile \ - src/libexpr/Makefile \ - src/nix-hash/Makefile \ - src/nix-store/Makefile \ - src/nix-instantiate/Makefile \ - src/nix-env/Makefile \ - src/nix-daemon/Makefile \ - src/nix-log2xml/Makefile \ - src/bsdiff-4.3/Makefile \ - perl/Makefile \ - scripts/Makefile \ - corepkgs/Makefile \ - tests/Makefile \ + src/boost/format/local.mk \ + src/libutil/local.mk \ + src/libstore/local.mk \ + src/libmain/local.mk \ + src/libexpr/local.mk \ + src/nix-hash/local.mk \ + src/nix-store/local.mk \ + src/nix-instantiate/local.mk \ + src/nix-env/local.mk \ + src/nix-daemon/local.mk \ + src/nix-log2xml/local.mk \ + src/bsdiff-4.3/local.mk \ + perl/local.mk \ + scripts/local.mk \ + corepkgs/local.mk \ + tests/local.mk \ GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr diff --git a/corepkgs/Makefile b/corepkgs/Makefile deleted file mode 100644 index a04e3e3fbc1d..000000000000 --- a/corepkgs/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -corepkgs_FILES = nar.nix buildenv.nix buildenv.pl unpack-channel.nix derivation.nix fetchurl.nix imported-drv-to-derivation.nix - -$(foreach file,config.nix $(corepkgs_FILES),$(eval $(call install-data-in,$(d)/$(file),$(datadir)/nix/corepkgs))) - -template_files += $(d)/config.nix diff --git a/corepkgs/local.mk b/corepkgs/local.mk new file mode 100644 index 000000000000..a04e3e3fbc1d --- /dev/null +++ b/corepkgs/local.mk @@ -0,0 +1,5 @@ +corepkgs_FILES = nar.nix buildenv.nix buildenv.pl unpack-channel.nix derivation.nix fetchurl.nix imported-drv-to-derivation.nix + +$(foreach file,config.nix $(corepkgs_FILES),$(eval $(call install-data-in,$(d)/$(file),$(datadir)/nix/corepkgs))) + +template_files += $(d)/config.nix diff --git a/perl/Makefile b/perl/Makefile deleted file mode 100644 index cd07631ca888..000000000000 --- a/perl/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -nix_perl_sources := \ - $(d)/lib/Nix/Store.pm \ - $(d)/lib/Nix/Manifest.pm \ - $(d)/lib/Nix/GeneratePatches.pm \ - $(d)/lib/Nix/SSH.pm \ - $(d)/lib/Nix/CopyClosure.pm \ - $(d)/lib/Nix/Config.pm.in \ - $(d)/lib/Nix/Utils.pm \ - $(d)/lib/Nix/Crypto.pm - -nix_perl_modules := $(nix_perl_sources:.in=) - -$(foreach x, $(nix_perl_modules), $(eval $(call install-data-in, $(x), $(perllibdir)/Nix))) - -ifeq ($(perlbindings), yes) - - $(d)/lib/Nix/Store.cc: $(d)/lib/Nix/Store.xs - xsubpp $^ -output $@ - - LIBS += Store - - Store_DIR := $(d)/lib/Nix - - Store_SOURCES := $(Store_DIR)/Store.cc - - Store_LIBS = libstore - - Store_CXXFLAGS = \ - -I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \ - -D_FILE_OFFSET_BITS=64 - - Store_ALLOW_UNDEFINED = 1 - - Store_FORCE_INSTALL = 1 - - Store_INSTALL_DIR = $(perllibdir)/auto/Nix/Store - -endif - -clean_files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc - -dist_files += $(nix_perl_sources) diff --git a/perl/local.mk b/perl/local.mk new file mode 100644 index 000000000000..cd07631ca888 --- /dev/null +++ b/perl/local.mk @@ -0,0 +1,42 @@ +nix_perl_sources := \ + $(d)/lib/Nix/Store.pm \ + $(d)/lib/Nix/Manifest.pm \ + $(d)/lib/Nix/GeneratePatches.pm \ + $(d)/lib/Nix/SSH.pm \ + $(d)/lib/Nix/CopyClosure.pm \ + $(d)/lib/Nix/Config.pm.in \ + $(d)/lib/Nix/Utils.pm \ + $(d)/lib/Nix/Crypto.pm + +nix_perl_modules := $(nix_perl_sources:.in=) + +$(foreach x, $(nix_perl_modules), $(eval $(call install-data-in, $(x), $(perllibdir)/Nix))) + +ifeq ($(perlbindings), yes) + + $(d)/lib/Nix/Store.cc: $(d)/lib/Nix/Store.xs + xsubpp $^ -output $@ + + LIBS += Store + + Store_DIR := $(d)/lib/Nix + + Store_SOURCES := $(Store_DIR)/Store.cc + + Store_LIBS = libstore + + Store_CXXFLAGS = \ + -I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \ + -D_FILE_OFFSET_BITS=64 + + Store_ALLOW_UNDEFINED = 1 + + Store_FORCE_INSTALL = 1 + + Store_INSTALL_DIR = $(perllibdir)/auto/Nix/Store + +endif + +clean_files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc + +dist_files += $(nix_perl_sources) diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index 2805128db8de..000000000000 --- a/scripts/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -nix_bin_scripts := \ - $(d)/nix-build \ - $(d)/nix-channel \ - $(d)/nix-collect-garbage \ - $(d)/nix-copy-closure \ - $(d)/nix-generate-patches \ - $(d)/nix-install-package \ - $(d)/nix-prefetch-url \ - $(d)/nix-pull \ - $(d)/nix-push - -bin_SCRIPTS += $(nix_bin_scripts) - -nix_substituters := \ - $(d)/copy-from-other-stores.pl \ - $(d)/download-from-binary-cache.pl \ - $(d)/download-using-manifests.pl - -nix_noinst_scripts := \ - $(d)/build-remote.pl \ - $(d)/find-runtime-roots.pl \ - $(d)/nix-http-export.cgi \ - $(d)/nix-profile.sh \ - $(d)/nix-reduce-build \ - $(nix_substituters) - -noinst_SCRIPTS += $(nix_noinst_scripts) - -profiledir = $(sysconfdir)/profile.d - -$(eval $(call install-file-as, $(d)/nix-profile.sh, $(profiledir)/nix.sh, 0644)) -$(eval $(call install-program-in, $(d)/find-runtime-roots.pl, $(libexecdir)/nix)) -$(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix)) -$(foreach prog, $(nix_substituters), $(eval $(call install-program-in, $(prog), $(libexecdir)/nix/substituters))) -$(eval $(call install-symlink, nix-build, $(bindir)/nix-shell)) - -clean_files += $(nix_bin_scripts) $(nix_noinst_scripts) - -dist_files += $(d)/*.in diff --git a/scripts/local.mk b/scripts/local.mk new file mode 100644 index 000000000000..2805128db8de --- /dev/null +++ b/scripts/local.mk @@ -0,0 +1,39 @@ +nix_bin_scripts := \ + $(d)/nix-build \ + $(d)/nix-channel \ + $(d)/nix-collect-garbage \ + $(d)/nix-copy-closure \ + $(d)/nix-generate-patches \ + $(d)/nix-install-package \ + $(d)/nix-prefetch-url \ + $(d)/nix-pull \ + $(d)/nix-push + +bin_SCRIPTS += $(nix_bin_scripts) + +nix_substituters := \ + $(d)/copy-from-other-stores.pl \ + $(d)/download-from-binary-cache.pl \ + $(d)/download-using-manifests.pl + +nix_noinst_scripts := \ + $(d)/build-remote.pl \ + $(d)/find-runtime-roots.pl \ + $(d)/nix-http-export.cgi \ + $(d)/nix-profile.sh \ + $(d)/nix-reduce-build \ + $(nix_substituters) + +noinst_SCRIPTS += $(nix_noinst_scripts) + +profiledir = $(sysconfdir)/profile.d + +$(eval $(call install-file-as, $(d)/nix-profile.sh, $(profiledir)/nix.sh, 0644)) +$(eval $(call install-program-in, $(d)/find-runtime-roots.pl, $(libexecdir)/nix)) +$(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix)) +$(foreach prog, $(nix_substituters), $(eval $(call install-program-in, $(prog), $(libexecdir)/nix/substituters))) +$(eval $(call install-symlink, nix-build, $(bindir)/nix-shell)) + +clean_files += $(nix_bin_scripts) $(nix_noinst_scripts) + +dist_files += $(d)/*.in diff --git a/src/boost/format/Makefile b/src/boost/format/Makefile deleted file mode 100644 index 17897fa59074..000000000000 --- a/src/boost/format/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -LIBS += libformat - -libformat_NAME = libnixformat - -libformat_DIR := $(d) - -libformat_SOURCES := $(wildcard $(d)/*.cc) diff --git a/src/boost/format/local.mk b/src/boost/format/local.mk new file mode 100644 index 000000000000..17897fa59074 --- /dev/null +++ b/src/boost/format/local.mk @@ -0,0 +1,7 @@ +LIBS += libformat + +libformat_NAME = libnixformat + +libformat_DIR := $(d) + +libformat_SOURCES := $(wildcard $(d)/*.cc) diff --git a/src/bsdiff-4.3/Makefile b/src/bsdiff-4.3/Makefile deleted file mode 100644 index aca1ac116205..000000000000 --- a/src/bsdiff-4.3/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -PROGRAMS += bsdiff bspatch - -bsdiff_DIR := $(d) -bsdiff_SOURCES := $(d)/bsdiff.c -bsdiff_LDFLAGS = -lbz2 $(bsddiff_compat_include) -bsdiff_INSTALL_DIR = $(libexecdir)/nix - -bspatch_DIR := $(d) -bspatch_SOURCES := $(d)/bspatch.c -bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) -bspatch_INSTALL_DIR = $(libexecdir)/nix - -dist_files += $(d)/compat-include/* diff --git a/src/bsdiff-4.3/local.mk b/src/bsdiff-4.3/local.mk new file mode 100644 index 000000000000..aca1ac116205 --- /dev/null +++ b/src/bsdiff-4.3/local.mk @@ -0,0 +1,13 @@ +PROGRAMS += bsdiff bspatch + +bsdiff_DIR := $(d) +bsdiff_SOURCES := $(d)/bsdiff.c +bsdiff_LDFLAGS = -lbz2 $(bsddiff_compat_include) +bsdiff_INSTALL_DIR = $(libexecdir)/nix + +bspatch_DIR := $(d) +bspatch_SOURCES := $(d)/bspatch.c +bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) +bspatch_INSTALL_DIR = $(libexecdir)/nix + +dist_files += $(d)/compat-include/* diff --git a/src/libexpr/Makefile b/src/libexpr/Makefile deleted file mode 100644 index de276aa65296..000000000000 --- a/src/libexpr/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -LIBS += libexpr - -libexpr_NAME = libnixexpr - -libexpr_DIR := $(d) - -libexpr_SOURCES := $(wildcard $(d)/*.cc) $(d)/lexer-tab.cc $(d)/parser-tab.cc - -libexpr_LIBS = libutil libstore libformat - -# The dependency on libgc must be propagated (i.e. meaning that -# programs/libraries that use libexpr must explicitly pass -lgc), -# because inline functions in libexpr's header files call libgc. -libexpr_LDFLAGS_PROPAGATED = $(BDW_GC_LIBS) - -$(d)/parser-tab.cc $(d)/parser-tab.hh: $(d)/parser.y - bison -v -o $(libexpr_DIR)/parser-tab.cc $< -d - -$(d)/lexer-tab.cc $(d)/lexer-tab.hh: $(d)/lexer.l - flex --outfile $(libexpr_DIR)/lexer-tab.cc --header-file=$(libexpr_DIR)/lexer-tab.hh $< diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk new file mode 100644 index 000000000000..de276aa65296 --- /dev/null +++ b/src/libexpr/local.mk @@ -0,0 +1,20 @@ +LIBS += libexpr + +libexpr_NAME = libnixexpr + +libexpr_DIR := $(d) + +libexpr_SOURCES := $(wildcard $(d)/*.cc) $(d)/lexer-tab.cc $(d)/parser-tab.cc + +libexpr_LIBS = libutil libstore libformat + +# The dependency on libgc must be propagated (i.e. meaning that +# programs/libraries that use libexpr must explicitly pass -lgc), +# because inline functions in libexpr's header files call libgc. +libexpr_LDFLAGS_PROPAGATED = $(BDW_GC_LIBS) + +$(d)/parser-tab.cc $(d)/parser-tab.hh: $(d)/parser.y + bison -v -o $(libexpr_DIR)/parser-tab.cc $< -d + +$(d)/lexer-tab.cc $(d)/lexer-tab.hh: $(d)/lexer.l + flex --outfile $(libexpr_DIR)/lexer-tab.cc --header-file=$(libexpr_DIR)/lexer-tab.hh $< diff --git a/src/libmain/Makefile b/src/libmain/Makefile deleted file mode 100644 index 0efeee531478..000000000000 --- a/src/libmain/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -LIBS += libmain - -libmain_NAME = libnixmain - -libmain_DIR := $(d) - -libmain_SOURCES := $(wildcard $(d)/*.cc) - -libmain_LIBS = libstore libutil libformat - -libmain_ALLOW_UNDEFINED = 1 diff --git a/src/libmain/local.mk b/src/libmain/local.mk new file mode 100644 index 000000000000..0efeee531478 --- /dev/null +++ b/src/libmain/local.mk @@ -0,0 +1,11 @@ +LIBS += libmain + +libmain_NAME = libnixmain + +libmain_DIR := $(d) + +libmain_SOURCES := $(wildcard $(d)/*.cc) + +libmain_LIBS = libstore libutil libformat + +libmain_ALLOW_UNDEFINED = 1 diff --git a/src/libstore/Makefile b/src/libstore/Makefile deleted file mode 100644 index dcedd4c26ab8..000000000000 --- a/src/libstore/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -LIBS += libstore - -libstore_NAME = libnixstore - -libstore_DIR := $(d) - -libstore_SOURCES := $(wildcard $(d)/*.cc) - -libstore_LIBS = libutil libformat - -libstore_LDFLAGS = -lsqlite3 -lbz2 - -libstore_CXXFLAGS = \ - -DNIX_STORE_DIR=\"$(storedir)\" \ - -DNIX_DATA_DIR=\"$(datadir)\" \ - -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \ - -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ - -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ - -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ - -DNIX_BIN_DIR=\"$(bindir)\" \ - -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" - -$(d)/local-store.cc: $(d)/schema.sql.hh - -%.sql.hh: %.sql - sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $< > $@ || (rm $@ && exit 1) diff --git a/src/libstore/local.mk b/src/libstore/local.mk new file mode 100644 index 000000000000..dcedd4c26ab8 --- /dev/null +++ b/src/libstore/local.mk @@ -0,0 +1,26 @@ +LIBS += libstore + +libstore_NAME = libnixstore + +libstore_DIR := $(d) + +libstore_SOURCES := $(wildcard $(d)/*.cc) + +libstore_LIBS = libutil libformat + +libstore_LDFLAGS = -lsqlite3 -lbz2 + +libstore_CXXFLAGS = \ + -DNIX_STORE_DIR=\"$(storedir)\" \ + -DNIX_DATA_DIR=\"$(datadir)\" \ + -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \ + -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ + -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ + -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ + -DNIX_BIN_DIR=\"$(bindir)\" \ + -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" + +$(d)/local-store.cc: $(d)/schema.sql.hh + +%.sql.hh: %.sql + sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $< > $@ || (rm $@ && exit 1) diff --git a/src/libutil/Makefile b/src/libutil/Makefile deleted file mode 100644 index 83bd05f281d6..000000000000 --- a/src/libutil/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -LIBS += libutil - -libutil_NAME = libnixutil - -libutil_DIR := $(d) - -libutil_SOURCES := $(wildcard $(d)/*.cc) - -ifeq ($(HAVE_OPENSSL), 1) - libutil_LDFLAGS = $(OPENSSL_LIBS) -else - libutil_SOURCES += $(d)/md5.c $(d)/sha1.c $(d)/sha256.c -endif - -libutil_LIBS = libformat diff --git a/src/libutil/local.mk b/src/libutil/local.mk new file mode 100644 index 000000000000..83bd05f281d6 --- /dev/null +++ b/src/libutil/local.mk @@ -0,0 +1,15 @@ +LIBS += libutil + +libutil_NAME = libnixutil + +libutil_DIR := $(d) + +libutil_SOURCES := $(wildcard $(d)/*.cc) + +ifeq ($(HAVE_OPENSSL), 1) + libutil_LDFLAGS = $(OPENSSL_LIBS) +else + 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 deleted file mode 100644 index d02f9f6ce22d..000000000000 --- a/src/nix-daemon/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PROGRAMS += nix-daemon - -nix-daemon_DIR := $(d) - -nix-daemon_SOURCES := $(d)/nix-daemon.cc - -nix-daemon_LIBS = libmain libstore libutil libformat - -$(eval $(call install-symlink, nix-daemon, $(bindir)/nix-worker)) diff --git a/src/nix-daemon/local.mk b/src/nix-daemon/local.mk new file mode 100644 index 000000000000..d02f9f6ce22d --- /dev/null +++ b/src/nix-daemon/local.mk @@ -0,0 +1,9 @@ +PROGRAMS += nix-daemon + +nix-daemon_DIR := $(d) + +nix-daemon_SOURCES := $(d)/nix-daemon.cc + +nix-daemon_LIBS = libmain libstore libutil libformat + +$(eval $(call install-symlink, nix-daemon, $(bindir)/nix-worker)) diff --git a/src/nix-env/Makefile b/src/nix-env/Makefile deleted file mode 100644 index 5a38d2fb76af..000000000000 --- a/src/nix-env/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PROGRAMS += nix-env - -nix-env_DIR := $(d) - -nix-env_SOURCES := $(wildcard $(d)/*.cc) - -nix-env_LIBS = libexpr libmain libstore libutil libformat diff --git a/src/nix-env/local.mk b/src/nix-env/local.mk new file mode 100644 index 000000000000..5a38d2fb76af --- /dev/null +++ b/src/nix-env/local.mk @@ -0,0 +1,7 @@ +PROGRAMS += nix-env + +nix-env_DIR := $(d) + +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 deleted file mode 100644 index 062e4d13b29e..000000000000 --- a/src/nix-hash/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PROGRAMS += nix-hash - -nix-hash_DIR := $(d) - -nix-hash_SOURCES := $(d)/nix-hash.cc - -nix-hash_LIBS = libmain libstore libutil libformat diff --git a/src/nix-hash/local.mk b/src/nix-hash/local.mk new file mode 100644 index 000000000000..062e4d13b29e --- /dev/null +++ b/src/nix-hash/local.mk @@ -0,0 +1,7 @@ +PROGRAMS += nix-hash + +nix-hash_DIR := $(d) + +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 deleted file mode 100644 index daa741eb7f08..000000000000 --- a/src/nix-instantiate/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PROGRAMS += nix-instantiate - -nix-instantiate_DIR := $(d) - -nix-instantiate_SOURCES := $(d)/nix-instantiate.cc - -nix-instantiate_LIBS = libexpr libmain libstore libutil libformat diff --git a/src/nix-instantiate/local.mk b/src/nix-instantiate/local.mk new file mode 100644 index 000000000000..daa741eb7f08 --- /dev/null +++ b/src/nix-instantiate/local.mk @@ -0,0 +1,7 @@ +PROGRAMS += nix-instantiate + +nix-instantiate_DIR := $(d) + +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 deleted file mode 100644 index 8467d1973bda..000000000000 --- a/src/nix-log2xml/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -PROGRAMS += nix-log2xml - -nix-log2xml_DIR := $(d) - -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-log2xml/local.mk b/src/nix-log2xml/local.mk new file mode 100644 index 000000000000..8467d1973bda --- /dev/null +++ b/src/nix-log2xml/local.mk @@ -0,0 +1,8 @@ +PROGRAMS += nix-log2xml + +nix-log2xml_DIR := $(d) + +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 deleted file mode 100644 index edd111b42015..000000000000 --- a/src/nix-store/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PROGRAMS += nix-store - -nix-store_DIR := $(d) - -nix-store_SOURCES := $(wildcard $(d)/*.cc) - -nix-store_LIBS = libmain libstore libutil libformat - -nix-store_LDFLAGS = -lbz2 diff --git a/src/nix-store/local.mk b/src/nix-store/local.mk new file mode 100644 index 000000000000..edd111b42015 --- /dev/null +++ b/src/nix-store/local.mk @@ -0,0 +1,9 @@ +PROGRAMS += nix-store + +nix-store_DIR := $(d) + +nix-store_SOURCES := $(wildcard $(d)/*.cc) + +nix-store_LIBS = libmain libstore libutil libformat + +nix-store_LDFLAGS = -lbz2 diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 21ffd047f6f2..000000000000 --- a/tests/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -check: - @echo "Warning: Nix has no 'make check'. Please install Nix and run 'make installcheck' instead." - -nix_tests = \ - init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ - parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ - fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ - referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \ - gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \ - remote-store.sh export.sh export-graph.sh negative-caching.sh \ - binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \ - multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \ - binary-cache.sh nix-profile.sh - -INSTALL_TESTS += $(foreach x, $(nix_tests), tests/$(x)) - -TESTS_ENVIRONMENT = NIX_REMOTE= $(bash) -e - -clean_files += $(d)/common.sh - -installcheck: $(d)/common.sh diff --git a/tests/local.mk b/tests/local.mk new file mode 100644 index 000000000000..21ffd047f6f2 --- /dev/null +++ b/tests/local.mk @@ -0,0 +1,21 @@ +check: + @echo "Warning: Nix has no 'make check'. Please install Nix and run 'make installcheck' instead." + +nix_tests = \ + init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ + parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ + fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ + referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \ + gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \ + remote-store.sh export.sh export-graph.sh negative-caching.sh \ + binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \ + multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \ + binary-cache.sh nix-profile.sh + +INSTALL_TESTS += $(foreach x, $(nix_tests), tests/$(x)) + +TESTS_ENVIRONMENT = NIX_REMOTE= $(bash) -e + +clean_files += $(d)/common.sh + +installcheck: $(d)/common.sh -- cgit 1.4.1 From ac8c2ef1aa30c50b568883d2051335a66437694f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 1 Feb 2014 11:30:21 +0100 Subject: Build/install manual --- Makefile | 4 ++- Makefile.config.in | 7 +++++ configure.ac | 6 ---- doc/manual/local.mk | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ misc/emacs/local.mk | 1 + 5 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 doc/manual/local.mk create mode 100644 misc/emacs/local.mk (limited to 'Makefile') diff --git a/Makefile b/Makefile index b7ffc1b037ce..f22a70a81c99 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,9 @@ SUBS = \ perl/local.mk \ scripts/local.mk \ corepkgs/local.mk \ - tests/local.mk \ + misc/emacs/local.mk \ + doc/manual/local.mk \ + tests/local.mk GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr diff --git a/Makefile.config.in b/Makefile.config.in index 130da2625618..f5f813b2c0fc 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -12,10 +12,15 @@ bindir = @bindir@ bsddiff_compat_include = @bsddiff_compat_include@ datadir = @datadir@ datarootdir = @datarootdir@ +dblatex = @dblatex@ +docbookrng = @docbookrng@ +docbookxsl = @docbookxsl@ +docdir = @docdir@ exec_prefix = @exec_prefix@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +mandir = @mandir@ perl = @perl@ perlbindings = @perlbindings@ perllibdir = @perllibdir@ @@ -23,3 +28,5 @@ pkglibdir = $(libdir)/$(PACKAGE_NAME) prefix = @prefix@ storedir = @storedir@ sysconfdir = @sysconfdir@ +xmllint = @xmllint@ +xsltproc = @xsltproc@ diff --git a/configure.ac b/configure.ac index aa57543e5166..043aed5b369a 100644 --- a/configure.ac +++ b/configure.ac @@ -203,12 +203,6 @@ AC_ARG_WITH(docbook-xsl, AC_HELP_STRING([--with-docbook-xsl=PATH], AC_SUBST(docbookxsl) -AC_ARG_WITH(xml-flags, AC_HELP_STRING([--with-xml-flags=FLAGS], - [extra flags to be passed to xmllint and xsltproc]), - xmlflags=$withval, xmlflags=) -AC_SUBST(xmlflags) - - AC_ARG_WITH(store-dir, AC_HELP_STRING([--with-store-dir=PATH], [path of the Nix store (defaults to /nix/store)]), storedir=$withval, storedir='/nix/store') diff --git a/doc/manual/local.mk b/doc/manual/local.mk new file mode 100644 index 000000000000..ae3a9df5c89f --- /dev/null +++ b/doc/manual/local.mk @@ -0,0 +1,79 @@ +XSLTPROC = $(xsltproc) --nonet $(xmlflags) \ + --param section.autolabel 1 \ + --param section.label.includes.component.label 1 \ + --param html.stylesheet \'style.css\' \ + --param xref.with.number.and.title 1 \ + --param toc.section.depth 3 \ + --param admon.style \'\' \ + --param callout.graphics.extension \'.gif\' \ + --param contrib.inline.enabled 0 + +MANUAL_SRCS := $(wildcard $(d)/*.xml) + + +# Do XInclude processing / RelaxNG validation +$(d)/manual.xmli: $(d)/manual.xml $(MANUAL_SRCS) $(d)/version.txt + $(trace-gen) $(xmllint) --nonet --xinclude $< -o $@.tmp + @mv $@.tmp $@ + +$(d)/version.txt: + $(trace-gen) echo -n $(PACKAGE_VERSION) > $@ + +# Note: RelaxNG validation requires xmllint >= 2.7.4. +$(d)/manual.is-valid: $(d)/manual.xmli + $(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ + $(xmllint) --nonet --noout --relaxng $(docbookrng)/docbook.rng - + @touch $@ + +clean_files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid + + +# Generate man pages. +man-pages := $(foreach n, \ + nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ + nix-collect-garbage.1 nix-push.1 nix-pull.1 \ + nix-prefetch-url.1 nix-channel.1 \ + nix-install-package.1 nix-hash.1 nix-copy-closure.1 \ + nix.conf.5 nix-daemon.8, \ + $(d)/$(n)) + +$(man-pages): $(d)/manual.xmli $(d)/manual.is-valid + $(trace-gen) $(XSLTPROC) --stringparam profile.condition manpage \ + $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ + (cd doc/manual && $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl -) + +clean_files += $(d)/*.1 $(d)/*.5 $(d)/*.8 + + +# Generate the HTML manual. +$(d)/manual.html: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid + $(trace-gen) $(XSLTPROC) --xinclude --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl $< | \ + $(XSLTPROC) --output $@ $(docbookxsl)/html/docbook.xsl - + +$(foreach file, $(d)/manual.html $(d)/style.css, $(eval $(call install-data-in, $(file), $(docdir)/manual))) + +$(foreach file, $(wildcard $(d)/figures/*.png), $(eval $(call install-data-in, $(file), $(docdir)/manual/figures))) + +$(foreach file, $(wildcard $(docbookxsl)/images/callouts/*.gif), $(eval $(call install-data-in, $(file), $(docdir)/manual/images/callouts))) + +$(eval $(call install-symlink, manual.html, $(docdir)/manual/index.html)) + +all: $(d)/manual.html + +clean_files += $(d)/manual.html + + +# Generate the PDF manual. +$(d)/manual.pdf: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid + $(trace-gen) if test "$(dblatex)" != ""; then \ + cd doc/manual && $(XSLTPROC) --xinclude --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl manual.xml | \ + $(dblatex) -o manual.pdf $(dblatex_opts) -; \ + else \ + echo "Please install dblatex and rerun configure."; \ + exit 1; \ + fi + +clean_files += $(d)/manual.pdf diff --git a/misc/emacs/local.mk b/misc/emacs/local.mk new file mode 100644 index 000000000000..8e06b881bcdf --- /dev/null +++ b/misc/emacs/local.mk @@ -0,0 +1 @@ +$(eval $(call install-data-in,$(d)/nix-mode.el,$(datadir)/emacs/site-lisp)) -- cgit 1.4.1 From 16e7d692092449263880ee795ec419cecbe22d24 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 1 Feb 2014 12:23:14 +0100 Subject: Update Makefile variable names --- Makefile | 2 +- corepkgs/local.mk | 2 +- doc/manual/local.mk | 8 ++++---- perl/local.mk | 6 +++--- scripts/local.mk | 8 ++++---- src/boost/format/local.mk | 2 +- src/bsdiff-4.3/local.mk | 4 ++-- src/libexpr/local.mk | 2 +- src/libmain/local.mk | 2 +- src/libstore/local.mk | 2 +- src/libutil/local.mk | 2 +- src/nix-daemon/local.mk | 2 +- src/nix-env/local.mk | 2 +- src/nix-hash/local.mk | 2 +- src/nix-instantiate/local.mk | 2 +- src/nix-log2xml/local.mk | 2 +- src/nix-store/local.mk | 2 +- tests/local.mk | 6 +++--- 18 files changed, 29 insertions(+), 29 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f22a70a81c99..df72578cc54b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBS = \ +makefiles = \ src/boost/format/local.mk \ src/libutil/local.mk \ src/libstore/local.mk \ diff --git a/corepkgs/local.mk b/corepkgs/local.mk index a04e3e3fbc1d..19c1d06962c0 100644 --- a/corepkgs/local.mk +++ b/corepkgs/local.mk @@ -2,4 +2,4 @@ corepkgs_FILES = nar.nix buildenv.nix buildenv.pl unpack-channel.nix derivation. $(foreach file,config.nix $(corepkgs_FILES),$(eval $(call install-data-in,$(d)/$(file),$(datadir)/nix/corepkgs))) -template_files += $(d)/config.nix +template-files += $(d)/config.nix diff --git a/doc/manual/local.mk b/doc/manual/local.mk index ae3a9df5c89f..8d49e1e4d5ae 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -26,7 +26,7 @@ $(d)/manual.is-valid: $(d)/manual.xmli $(xmllint) --nonet --noout --relaxng $(docbookrng)/docbook.rng - @touch $@ -clean_files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid +clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid # Generate man pages. @@ -43,7 +43,7 @@ $(man-pages): $(d)/manual.xmli $(d)/manual.is-valid $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ (cd doc/manual && $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl -) -clean_files += $(d)/*.1 $(d)/*.5 $(d)/*.8 +clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8 # Generate the HTML manual. @@ -62,7 +62,7 @@ $(eval $(call install-symlink, manual.html, $(docdir)/manual/index.html)) all: $(d)/manual.html -clean_files += $(d)/manual.html +clean-files += $(d)/manual.html # Generate the PDF manual. @@ -76,4 +76,4 @@ $(d)/manual.pdf: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid exit 1; \ fi -clean_files += $(d)/manual.pdf +clean-files += $(d)/manual.pdf diff --git a/perl/local.mk b/perl/local.mk index cd07631ca888..b5550cc9f87c 100644 --- a/perl/local.mk +++ b/perl/local.mk @@ -17,7 +17,7 @@ ifeq ($(perlbindings), yes) $(d)/lib/Nix/Store.cc: $(d)/lib/Nix/Store.xs xsubpp $^ -output $@ - LIBS += Store + libraries += Store Store_DIR := $(d)/lib/Nix @@ -37,6 +37,6 @@ ifeq ($(perlbindings), yes) endif -clean_files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc +clean-files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc -dist_files += $(nix_perl_sources) +dist-files += $(nix_perl_sources) diff --git a/scripts/local.mk b/scripts/local.mk index 2805128db8de..606b73df6c74 100644 --- a/scripts/local.mk +++ b/scripts/local.mk @@ -9,7 +9,7 @@ nix_bin_scripts := \ $(d)/nix-pull \ $(d)/nix-push -bin_SCRIPTS += $(nix_bin_scripts) +bin-scripts += $(nix_bin_scripts) nix_substituters := \ $(d)/copy-from-other-stores.pl \ @@ -24,7 +24,7 @@ nix_noinst_scripts := \ $(d)/nix-reduce-build \ $(nix_substituters) -noinst_SCRIPTS += $(nix_noinst_scripts) +noinst-scripts += $(nix_noinst_scripts) profiledir = $(sysconfdir)/profile.d @@ -34,6 +34,6 @@ $(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix)) $(foreach prog, $(nix_substituters), $(eval $(call install-program-in, $(prog), $(libexecdir)/nix/substituters))) $(eval $(call install-symlink, nix-build, $(bindir)/nix-shell)) -clean_files += $(nix_bin_scripts) $(nix_noinst_scripts) +clean-files += $(nix_bin_scripts) $(nix_noinst_scripts) -dist_files += $(d)/*.in +dist-files += $(d)/*.in diff --git a/src/boost/format/local.mk b/src/boost/format/local.mk index 17897fa59074..3776eff382fe 100644 --- a/src/boost/format/local.mk +++ b/src/boost/format/local.mk @@ -1,4 +1,4 @@ -LIBS += libformat +libraries += libformat libformat_NAME = libnixformat diff --git a/src/bsdiff-4.3/local.mk b/src/bsdiff-4.3/local.mk index aca1ac116205..320795a94c1b 100644 --- a/src/bsdiff-4.3/local.mk +++ b/src/bsdiff-4.3/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += bsdiff bspatch +programs += bsdiff bspatch bsdiff_DIR := $(d) bsdiff_SOURCES := $(d)/bsdiff.c @@ -10,4 +10,4 @@ bspatch_SOURCES := $(d)/bspatch.c bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) bspatch_INSTALL_DIR = $(libexecdir)/nix -dist_files += $(d)/compat-include/* +dist-files += $(d)/compat-include/* diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk index de276aa65296..ff35155b1a96 100644 --- a/src/libexpr/local.mk +++ b/src/libexpr/local.mk @@ -1,4 +1,4 @@ -LIBS += libexpr +libraries += libexpr libexpr_NAME = libnixexpr diff --git a/src/libmain/local.mk b/src/libmain/local.mk index 0efeee531478..71a07d1979ab 100644 --- a/src/libmain/local.mk +++ b/src/libmain/local.mk @@ -1,4 +1,4 @@ -LIBS += libmain +libraries += libmain libmain_NAME = libnixmain diff --git a/src/libstore/local.mk b/src/libstore/local.mk index dcedd4c26ab8..a9ae53270076 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -1,4 +1,4 @@ -LIBS += libstore +libraries += libstore libstore_NAME = libnixstore diff --git a/src/libutil/local.mk b/src/libutil/local.mk index 83bd05f281d6..8af2e78d9ce4 100644 --- a/src/libutil/local.mk +++ b/src/libutil/local.mk @@ -1,4 +1,4 @@ -LIBS += libutil +libraries += libutil libutil_NAME = libnixutil diff --git a/src/nix-daemon/local.mk b/src/nix-daemon/local.mk index d02f9f6ce22d..db071a3f7c7e 100644 --- a/src/nix-daemon/local.mk +++ b/src/nix-daemon/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-daemon +programs += nix-daemon nix-daemon_DIR := $(d) diff --git a/src/nix-env/local.mk b/src/nix-env/local.mk index 5a38d2fb76af..e80719cd76f7 100644 --- a/src/nix-env/local.mk +++ b/src/nix-env/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-env +programs += nix-env nix-env_DIR := $(d) diff --git a/src/nix-hash/local.mk b/src/nix-hash/local.mk index 062e4d13b29e..7c290ca8466e 100644 --- a/src/nix-hash/local.mk +++ b/src/nix-hash/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-hash +programs += nix-hash nix-hash_DIR := $(d) diff --git a/src/nix-instantiate/local.mk b/src/nix-instantiate/local.mk index daa741eb7f08..7d1bc5ec9dfb 100644 --- a/src/nix-instantiate/local.mk +++ b/src/nix-instantiate/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-instantiate +programs += nix-instantiate nix-instantiate_DIR := $(d) diff --git a/src/nix-log2xml/local.mk b/src/nix-log2xml/local.mk index 8467d1973bda..46eb2e02ca64 100644 --- a/src/nix-log2xml/local.mk +++ b/src/nix-log2xml/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-log2xml +programs += nix-log2xml nix-log2xml_DIR := $(d) diff --git a/src/nix-store/local.mk b/src/nix-store/local.mk index edd111b42015..7f93e4c19196 100644 --- a/src/nix-store/local.mk +++ b/src/nix-store/local.mk @@ -1,4 +1,4 @@ -PROGRAMS += nix-store +programs += nix-store nix-store_DIR := $(d) diff --git a/tests/local.mk b/tests/local.mk index 21ffd047f6f2..87f4e25e6024 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -12,10 +12,10 @@ nix_tests = \ multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \ binary-cache.sh nix-profile.sh -INSTALL_TESTS += $(foreach x, $(nix_tests), tests/$(x)) +install-tests += $(foreach x, $(nix_tests), tests/$(x)) -TESTS_ENVIRONMENT = NIX_REMOTE= $(bash) -e +tests-environment = NIX_REMOTE= $(bash) -e -clean_files += $(d)/common.sh +clean-files += $(d)/common.sh installcheck: $(d)/common.sh -- cgit 1.4.1 From 6ef32bddc1f10034322966b3a5b85af7b9cdc4d8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 1 Feb 2014 14:28:31 +0100 Subject: Fix "make dist" --- Makefile | 3 +-- doc/manual/local.mk | 5 +++++ local.mk | 3 +++ perl/local.mk | 4 +--- release.nix | 5 ++--- scripts/local.mk | 2 -- src/bsdiff-4.3/local.mk | 2 -- src/libexpr/local.mk | 6 ++++-- src/libstore/local.mk | 4 +++- 9 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 local.mk (limited to 'Makefile') diff --git a/Makefile b/Makefile index df72578cc54b..0ad6bb236c82 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ makefiles = \ + local.mk \ src/boost/format/local.mk \ src/libutil/local.mk \ src/libstore/local.mk \ @@ -18,8 +19,6 @@ makefiles = \ doc/manual/local.mk \ tests/local.mk -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/doc/manual/local.mk b/doc/manual/local.mk index 8d49e1e4d5ae..92413eb7e2b2 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -28,6 +28,8 @@ $(d)/manual.is-valid: $(d)/manual.xmli clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid +clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid + # Generate man pages. man-pages := $(foreach n, \ @@ -64,6 +66,8 @@ all: $(d)/manual.html clean-files += $(d)/manual.html +dist-files += $(d)/manual.html + # Generate the PDF manual. $(d)/manual.pdf: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid @@ -77,3 +81,4 @@ $(d)/manual.pdf: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid fi clean-files += $(d)/manual.pdf + diff --git a/local.mk b/local.mk new file mode 100644 index 000000000000..6c99ab233273 --- /dev/null +++ b/local.mk @@ -0,0 +1,3 @@ +dist-files += $(shell git ls-files) $(shell git ls-files) + +GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr diff --git a/perl/local.mk b/perl/local.mk index b5550cc9f87c..74c054e7133f 100644 --- a/perl/local.mk +++ b/perl/local.mk @@ -15,7 +15,7 @@ $(foreach x, $(nix_perl_modules), $(eval $(call install-data-in, $(x), $(perllib ifeq ($(perlbindings), yes) $(d)/lib/Nix/Store.cc: $(d)/lib/Nix/Store.xs - xsubpp $^ -output $@ + $(trace-gen) xsubpp $^ -output $@ libraries += Store @@ -38,5 +38,3 @@ ifeq ($(perlbindings), yes) endif clean-files += $(d)/lib/Nix/Config.pm $(d)/lib/Nix/Store.cc - -dist-files += $(nix_perl_sources) diff --git a/release.nix b/release.nix index 67087190942f..29bceca7c722 100644 --- a/release.nix +++ b/release.nix @@ -30,7 +30,6 @@ let configureFlags = '' --with-docbook-rng=${docbook5}/xml/rng/docbook --with-docbook-xsl=${docbook5_xsl}/xml/xsl/docbook - --with-xml-flags=--nonet --with-dbi=${perlPackages.DBI}/${perl.libPrefix} --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix} --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} @@ -56,9 +55,9 @@ let ''; preDist = '' - make -C doc/manual install prefix=$out + make install prefix=$out makefiles=doc/manual/local.mk - make -C doc/manual manual.pdf prefix=$out + make doc/manual/manual.pdf cp doc/manual/manual.pdf $out/manual.pdf # The PDF containes filenames of included graphics (see diff --git a/scripts/local.mk b/scripts/local.mk index 606b73df6c74..f4c5e8097de4 100644 --- a/scripts/local.mk +++ b/scripts/local.mk @@ -35,5 +35,3 @@ $(foreach prog, $(nix_substituters), $(eval $(call install-program-in, $(prog), $(eval $(call install-symlink, nix-build, $(bindir)/nix-shell)) clean-files += $(nix_bin_scripts) $(nix_noinst_scripts) - -dist-files += $(d)/*.in diff --git a/src/bsdiff-4.3/local.mk b/src/bsdiff-4.3/local.mk index 320795a94c1b..c957ceab0c0f 100644 --- a/src/bsdiff-4.3/local.mk +++ b/src/bsdiff-4.3/local.mk @@ -9,5 +9,3 @@ bspatch_DIR := $(d) bspatch_SOURCES := $(d)/bspatch.c bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) bspatch_INSTALL_DIR = $(libexecdir)/nix - -dist-files += $(d)/compat-include/* diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk index ff35155b1a96..85e476e39b21 100644 --- a/src/libexpr/local.mk +++ b/src/libexpr/local.mk @@ -14,7 +14,9 @@ libexpr_LIBS = libutil libstore libformat libexpr_LDFLAGS_PROPAGATED = $(BDW_GC_LIBS) $(d)/parser-tab.cc $(d)/parser-tab.hh: $(d)/parser.y - bison -v -o $(libexpr_DIR)/parser-tab.cc $< -d + $(trace-gen) bison -v -o $(libexpr_DIR)/parser-tab.cc $< -d $(d)/lexer-tab.cc $(d)/lexer-tab.hh: $(d)/lexer.l - flex --outfile $(libexpr_DIR)/lexer-tab.cc --header-file=$(libexpr_DIR)/lexer-tab.hh $< + $(trace-gen) flex --outfile $(libexpr_DIR)/lexer-tab.cc --header-file=$(libexpr_DIR)/lexer-tab.hh $< + +clean-files += $(d)/parser-tab.cc $(d)/parser-tab.hh $(d)/lexer-tab.cc $(d)/lexer-tab.hh diff --git a/src/libstore/local.mk b/src/libstore/local.mk index a9ae53270076..2dddce740dcc 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -23,4 +23,6 @@ libstore_CXXFLAGS = \ $(d)/local-store.cc: $(d)/schema.sql.hh %.sql.hh: %.sql - sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $< > $@ || (rm $@ && exit 1) + $(trace-gen) sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $< > $@ || (rm $@ && exit 1) + +clean-files += $(d)/schema.sql.hh -- cgit 1.4.1