From b8e9efc476abc248a17c9e9cd117f3d53e4a7f63 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 15:54:18 +0100 Subject: New non-recursive, plain Make-based build system --- Makefile.config.in | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Makefile.config.in (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in new file mode 100644 index 000000000000..3bb8cdda48ba --- /dev/null +++ b/Makefile.config.in @@ -0,0 +1,10 @@ +VERSION = @VERSION@ +bindir = @bindir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +exec_prefix = @exec_prefix@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +prefix = @prefix@ +storedir = @storedir@ +sysconfdir = @sysconfdir@ -- cgit 1.4.1 From 62e35cc3a893e3bc4ed1fe2a37ba67af9859b4cb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 16:42:25 +0100 Subject: Add ‘make dist’ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile.config.in | 3 ++- Makefile.lib | 24 ++++++++++++++++++++---- src/libstore/Makefile.new | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index 3bb8cdda48ba..25e537bcca07 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,4 +1,5 @@ -VERSION = @VERSION@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ bindir = @bindir@ datadir = @datadir@ datarootdir = @datarootdir@ diff --git a/Makefile.lib b/Makefile.lib index 79078c83be35..c7880ff11421 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -16,7 +16,8 @@ libs_list := define LIBS_template = _d := $$($(1)_DIR) - _objs := $$(foreach src, $$($(1)_SOURCES), $$(_d)$$(basename $$(src)).o) + _srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)$$(src)) + _objs := $$(addsuffix .o, $$(basename $$(_srcs))) _libs := $$(foreach lib, $$($(1)_LIBS), $$(lib).a) _lib := $$(_d)$(1).a @@ -28,8 +29,9 @@ define LIBS_template = include $$(wildcard $$(_d)/*.dep) - clean_list += $$(_d)*.a $$(_d)*.o $$(_d)*.dep libs_list += $$(_lib) + clean_list += $$(_d)*.a $$(_d)*.o $$(_d)*.dep + dist_files += $$(_srcs) endef @@ -38,7 +40,8 @@ programs_list := define PROGRAMS_template = _d := $$($(1)_DIR) - _objs := $$(foreach src, $$($(1)_SOURCES), $$(_d)$$(basename $$(src)).o) + _srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)$$(src)) + _objs := $$(addsuffix .o, $$(basename $$(_srcs))) _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_DIR)$$(lib).a) _prog := $$(_d)$(1) @@ -48,11 +51,24 @@ define PROGRAMS_template = # Propagate CXXFLAGS to the individual object files. $$(foreach obj, $$(_objs), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS))) - clean_list += $$(_prog) $$(_d)*.o $$(_d)*.dep + include $$(wildcard $$(_d)/*.dep) + programs_list += $$(_prog) + clean_list += $$(_prog) $$(_d)*.o $$(_d)*.dep + dist_files += $$(_srcs) endef +# Distributing stuff. +dist_files := + +dist_name = $(PACKAGE_NAME)-$(PACKAGE_VERSION) + +dist: + @echo $(dist_files) + $(QUIET) tar cvfj $(dist_name).tar.bz2 $(dist_files) --transform 's,^,$(dist_name)/,' + + # Cleaning stuff. clean_list := diff --git a/src/libstore/Makefile.new b/src/libstore/Makefile.new index 24011c244349..7b08af047e2c 100644 --- a/src/libstore/Makefile.new +++ b/src/libstore/Makefile.new @@ -16,4 +16,4 @@ libstore_CXXFLAGS = \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ -DNIX_BIN_DIR=\"$(bindir)\" \ - -DNIX_VERSION=\"$(VERSION)\" + -DNIX_VERSION=\"$(PACKAGE_VERSION)\" -- cgit 1.4.1 From ffdc85fc8afba0828bd1f300fdb4f68de99d7000 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 15:47:47 +0000 Subject: Respect configure flags --- Makefile.config.in | 4 ++++ Makefile.lib | 4 ++-- Makefile.new | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index 25e537bcca07..e5a6f4c68d8b 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,3 +1,7 @@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ bindir = @bindir@ diff --git a/Makefile.lib b/Makefile.lib index c7880ff11421..449f19ad506f 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -5,10 +5,10 @@ here = $(dir $(lastword $(MAKEFILE_LIST))) QUIET = @ %.o: %.cc - $(QUIET) g++ -o $@ -c $< -g -fPIC $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP + $(QUIET) $(CXX) -o $@ -c $< -g -fPIC $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP %.o: %.c - $(QUIET) gcc -o $@ -c $< -g -fPIC $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP + $(QUIET) $(CC) -o $@ -c $< -g -fPIC $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP # Generate Make rules for libraries. diff --git a/Makefile.new b/Makefile.new index 566f1f7be5dd..8911d6d72c40 100644 --- a/Makefile.new +++ b/Makefile.new @@ -12,9 +12,7 @@ include src/nix-instantiate/Makefile.new include src/nix-env/Makefile.new include src/nix-daemon/Makefile.new -CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr - -CFLAGS = +CXXFLAGS += -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr $(foreach lib, $(LIBS), $(eval $(call LIBS_template,$(lib)))) $(foreach prog, $(PROGRAMS), $(eval $(call PROGRAMS_template,$(prog)))) -- cgit 1.4.1 From 6b5f89f2cf954cae1623a6cd3a8f7eb78e19e85b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 19:30:24 +0000 Subject: Drop the dependency on Automake --- Makefile.config.in | 2 ++ Makefile.lib | 13 +++++++------ configure.ac | 12 ++++-------- src/libstore/Makefile.new | 2 +- src/libstore/globals.cc | 2 +- src/libutil/Makefile.new | 4 +++- 6 files changed, 18 insertions(+), 17 deletions(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index e5a6f4c68d8b..45fb74c91184 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -2,6 +2,8 @@ CC = @CC@ CFLAGS = @CFLAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ bindir = @bindir@ diff --git a/Makefile.lib b/Makefile.lib index f2eea7ac81d2..6c59c759695e 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -1,6 +1,13 @@ default: all +# Include Autoconf variables. +Makefile.config: Makefile.config.in + ./config.status + +include Makefile.config + + # Include all sub-Makefiles. define include_sub_makefile = d := $$(patsubst %/, %, $$(dir $(1))) @@ -10,12 +17,6 @@ endef $(foreach mf, $(SUBS), $(eval $(call include_sub_makefile, $(mf)))) -# Include Autoconf variables. -Makefile.config: Makefile.config.in - ./config.status - -include Makefile.config - clean_list := dist_files := diff --git a/configure.ac b/configure.ac index c64766a2d244..5ecf2d952959 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,6 @@ AC_INIT(nix, m4_esyscmd([echo -n $(cat ./version)$VERSION_SUFFIX])) AC_CONFIG_SRCDIR(README) AC_CONFIG_AUX_DIR(config) -AM_INIT_AUTOMAKE([dist-bzip2 foreign]) - -AC_DEFINE_UNQUOTED(NIX_VERSION, ["$VERSION"], [Nix version.]) AC_PROG_SED @@ -252,8 +249,8 @@ AC_DEFINE_UNQUOTED(OPENSSL_PATH, ["$openssl_prog"], [Path of the OpenSSL binary] PKG_CHECK_MODULES([OPENSSL], [libcrypto], [AC_DEFINE([HAVE_OPENSSL], [1], [Whether to use OpenSSL.]) CXXFLAGS="$OPENSSL_CFLAGS $CXXFLAGS" - have_openssl=1], [true]) -AM_CONDITIONAL(HAVE_OPENSSL, test "$have_openssl" = 1) + have_openssl=1], [have_openssl=]) +AC_SUBST(HAVE_OPENSSL, [$have_openssl]) # Look for libbz2, a required dependency. @@ -319,7 +316,6 @@ if test "$enable_shared" = no; then # Perl bindings require shared libraries. perlbindings=no fi -AM_CONDITIONAL(PERL_BINDINGS, test "$perlbindings" = "yes") AC_SUBST(perlbindings) AC_MSG_RESULT($perlbindings) @@ -327,7 +323,7 @@ AC_MSG_RESULT($perlbindings) AC_ARG_ENABLE(init-state, AC_HELP_STRING([--disable-init-state], [do not initialise DB etc. in `make install']), init_state=$enableval, init_state=yes) -AM_CONDITIONAL(INIT_STATE, test "$init_state" = "yes") +#AM_CONDITIONAL(INIT_STATE, test "$init_state" = "yes") # Setuid installations. @@ -361,7 +357,7 @@ fi AC_SUBST(tarFlags) -AM_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([Makefile src/Makefile src/boost/Makefile diff --git a/src/libstore/Makefile.new b/src/libstore/Makefile.new index 2eb34b7b4252..0a384e0b1d44 100644 --- a/src/libstore/Makefile.new +++ b/src/libstore/Makefile.new @@ -16,4 +16,4 @@ libstore_CXXFLAGS = \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ -DNIX_BIN_DIR=\"$(bindir)\" \ - -DNIX_VERSION=\"$(PACKAGE_VERSION)\" + -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 1ecc629cb55f..68add1982f43 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -212,7 +212,7 @@ Settings::SettingsMap Settings::getOverrides() } -const string nixVersion = NIX_VERSION; +const string nixVersion = PACKAGE_VERSION; } diff --git a/src/libutil/Makefile.new b/src/libutil/Makefile.new index 88d43f0aeb62..7871a4ddb8c8 100644 --- a/src/libutil/Makefile.new +++ b/src/libutil/Makefile.new @@ -4,7 +4,9 @@ libutil_DIR := $(d) libutil_SOURCES = util.cc hash.cc serialise.cc archive.cc xml-writer.cc affinity.cc -ifneq ($(HAVE_OPENSSL), 1) +ifeq ($(HAVE_OPENSSL), 1) +libutil_LDFLAGS = $(OPENSSL_LIBS) +else libutil_SOURCES += md5.c sha1.c sha256.c endif -- cgit 1.4.1 From 812b5a30ecc9d8f78b54644b37c5c2c4375555bc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 19:51:18 +0000 Subject: Add a Makefile variable for enabling debug info --- Makefile.config.in | 1 + Makefile.lib | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index 45fb74c91184..bfe3deab9a6f 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,3 +1,4 @@ +BUILD_DEBUG = 1 CC = @CC@ CFLAGS = @CFLAGS@ CXX = @CXX@ diff --git a/Makefile.lib b/Makefile.lib index 4df40c9d2cf4..b045534dcca8 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -17,17 +17,33 @@ endef $(foreach mf, $(SUBS), $(eval $(call include_sub_makefile, $(mf)))) +# Initialise some variables. clean_list := dist_files := +QUIET = @ -QUIET = @ +# Pass -fPIC if we're building dynamic libraries. +ifeq ($(BUILD_SHARED_LIBS), 1) +GLOBAL_CFLAGS += -fPIC +GLOBAL_CXXFLAGS += -fPIC +endif + + +# Pass -g if we want debug info. +ifeq ($(BUILD_DEBUG), 1) +GLOBAL_CFLAGS += -g +GLOBAL_CXXFLAGS += -g +endif + + +# Pattern rules. %.o: %.cc - $(QUIET) $(CXX) -o $@ -c $< -g -fPIC $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP + $(QUIET) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP %.o: %.c - $(QUIET) $(CC) -o $@ -c $< -g -fPIC $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP + $(QUIET) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP # Generate Make rules for libraries. @@ -91,7 +107,6 @@ dist: # Cleaning stuff. - clean: rm -fv $(clean_list) -- cgit 1.4.1 From 9b11a8bfbcfd9e6f40ae8b573d4de492a23b91b9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 20:05:00 +0000 Subject: Fix building without Boehm GC --- Makefile.config.in | 1 + src/libmain/Makefile.new | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index bfe3deab9a6f..ed38e2980bf8 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,3 +1,4 @@ +BDW_GC_LIBS = @BDW_GC_LIBS@ BUILD_DEBUG = 1 CC = @CC@ CFLAGS = @CFLAGS@ diff --git a/src/libmain/Makefile.new b/src/libmain/Makefile.new index b198d78422b7..9e26aa8b9e53 100644 --- a/src/libmain/Makefile.new +++ b/src/libmain/Makefile.new @@ -4,4 +4,4 @@ libmain_DIR := $(d) libmain_SOURCES = shared.cc stack.cc -libmain_LDFLAGS = -lgc +libmain_LDFLAGS = $(BDW_GC_LIBS) -- cgit 1.4.1 From 14772783e66a6e67726872926834c0e9f7210e6d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 23 Nov 2013 20:32:20 +0100 Subject: Support installation of dynamically linked programs Here we need to re-link programs so that their RPATH refers to the installed libraries. --- Makefile.config.in | 2 ++ Makefile.lib | 42 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 5 deletions(-) (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index ed38e2980bf8..48baa2889404 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -12,8 +12,10 @@ bindir = @bindir@ datadir = @datadir@ datarootdir = @datarootdir@ exec_prefix = @exec_prefix@ +libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +pkglibdir = $(libdir)/$(PACKAGE_NAME) prefix = @prefix@ storedir = @storedir@ sysconfdir = @sysconfdir@ diff --git a/Makefile.lib b/Makefile.lib index 1c4ada9c2ee8..0a2fcccadcc6 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -55,20 +55,40 @@ define LIBS_template = _objs := $$(addsuffix .o, $$(basename $$(_srcs))) $(1)_LDFLAGS_USE := + $(1)_LDFLAGS_USE_INSTALLED := ifeq ($(BUILD_SHARED_LIBS), 1) + _lib := $$(_d)/$(1).so $$(_lib): $$(_objs) $(QUIET) $(CC) -o $$@ -shared $$^ $$($(1)_LDFLAGS) + $(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $(1))) + + $(1)_INSTALL_DIR := $$(pkglibdir) + + $(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$(1).so + + $$($(1)_INSTALL_PATH): $$(_objs) + install -d $$($(1)_INSTALL_DIR) + $(QUIET) $(CC) -o $$@ -shared $$^ $$($(1)_LDFLAGS) + + $(1)_LDFLAGS_USE_INSTALLED += -L$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $(1))) + else + _lib := $$(_d)/$(1).a $$(_lib): $$(_objs) $(QUIET) ar crs $$@ $$? + $(1)_LDFLAGS_USE += $$(_lib) $$($(1)_LDFLAGS) + + $(1)_INSTALL_PATH := $$(pkglibdir)/$(1).a + endif $(1)_LDFLAGS_USE += $$($(1)_LDFLAGS_PROPAGATED) + $(1)_LDFLAGS_USE_INSTALLED += $$($(1)_LDFLAGS_PROPAGATED) $(1)_NAME := $$(_lib) # Propagate CXXFLAGS to the individual object files. @@ -99,19 +119,31 @@ define PROGRAMS_template = $(1)_INSTALL_PATH := $$(bindir)/$(1) - $$($(1)_INSTALL_PATH): $$($(1)_PATH) - mkdir -p $$(dir $$@) + install:: $$($(1)_INSTALL_PATH) + + ifeq ($(BUILD_SHARED_LIBS), 1) + + _libs_final := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_INSTALL_PATH)) + + $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) + install -d $$(dir $$($(1)_INSTALL_PATH)) + $(QUIET) $(CXX) -o $$($(1)_INSTALL_PATH) -Wl,--no-copy-dt-needed-entries $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) + + else + + $$($(1)_INSTALL_PATH): $$($(1)_PATH) + install -d $$(dir $$($(1)_INSTALL_PATH)) cp $$< $$@ - install:: $$($(1)_INSTALL_PATH) + endif # Propagate CXXFLAGS to the individual object files. $$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS))) include $$(wildcard $$(_d)/*.dep) - programs_list += $$(_prog) - clean_list += $$(_prog) $$(_d)/*.o $$(_d)/*.dep + programs_list += $$($(1)_PATH) + clean_list += $$($(1)_PATH) $$(_d)/*.o $$(_d)/*.dep dist_files += $$(_srcs) endef -- cgit 1.4.1 From 1a1d8b073a1d770c8de4f8eb274387b209b32782 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Nov 2013 11:39:21 +0000 Subject: Add a Makefile for bsdiff --- Makefile.config.in | 1 + Makefile.new | 1 + mk/programs.mk | 5 +++-- src/bsdiff-4.3/Makefile.new | 13 +++++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/bsdiff-4.3/Makefile.new (limited to 'Makefile.config.in') diff --git a/Makefile.config.in b/Makefile.config.in index 48baa2889404..b9d9bd1c46f4 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -9,6 +9,7 @@ OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ bindir = @bindir@ +bsddiff_compat_include = @bsddiff_compat_include@ datadir = @datadir@ datarootdir = @datarootdir@ exec_prefix = @exec_prefix@ diff --git a/Makefile.new b/Makefile.new index ed090a1f4739..b3ff2fc1b4ef 100644 --- a/Makefile.new +++ b/Makefile.new @@ -10,6 +10,7 @@ SUBS = \ src/nix-env/Makefile.new \ src/nix-daemon/Makefile.new \ src/nix-log2xml/Makefile.new \ + src/bsdiff-4.3/Makefile.new \ corepkgs/Makefile.new GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr diff --git a/mk/programs.mk b/mk/programs.mk index e26e9af7a394..48f95c60c981 100644 --- a/mk/programs.mk +++ b/mk/programs.mk @@ -13,7 +13,8 @@ programs_list := # # - $(1)_LDFLAGS: additional linker flags. # -# - bindir: the directory where the program will be installed. +# - $(1)_INSTALL_DIR: the directory where the program will be +# installed; defaults to $(bindir). define build-program = _d := $$($(1)_DIR) _srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src)) @@ -24,7 +25,7 @@ define build-program = $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) $(QUIET) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) - $(1)_INSTALL_DIR := $$(bindir) + $(1)_INSTALL_DIR ?= $$(bindir) $(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$(1) $$(eval $$(call create-dir,$$($(1)_INSTALL_DIR))) diff --git a/src/bsdiff-4.3/Makefile.new b/src/bsdiff-4.3/Makefile.new new file mode 100644 index 000000000000..a56f6c124db0 --- /dev/null +++ b/src/bsdiff-4.3/Makefile.new @@ -0,0 +1,13 @@ +PROGRAMS += bsdiff bspatch + +bsdiff_DIR := $(d) +bsdiff_SOURCES = bsdiff.c +bsdiff_LDFLAGS = -lbz2 $(bsddiff_compat_include) +bsdiff_INSTALL_DIR = $(libexecdir) + +bspatch_DIR := $(d) +bspatch_SOURCES = bspatch.c +bspatch_LDFLAGS = -lbz2 $(bsddiff_compat_include) +bspatch_INSTALL_DIR = $(libexecdir) + +dist_files += $(d)/compat-include/* -- 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.config.in') 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.config.in') 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 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.config.in') 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