From 62e35cc3a893e3bc4ed1fe2a37ba67af9859b4cb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 16:42:25 +0100 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=98make=20dist=E2=80=99=20support?= 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(-) diff --git a/Makefile.config.in b/Makefile.config.in index 3bb8cdda4..25e537bcc 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 79078c83b..c7880ff11 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 24011c244..7b08af047 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)\"