From 4315acb8c0a40703b17f837ab82e9a691b5c14ab Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Nov 2013 08:55:19 +0000 Subject: [PATCH] Add a generic rule for installing files --- Makefile.lib | 14 +++++++++++++- corepkgs/Makefile.new | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 corepkgs/Makefile.new diff --git a/Makefile.lib b/Makefile.lib index b9114a07c..cacf92105 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -3,11 +3,23 @@ default: all # Include Autoconf variables. Makefile.config: Makefile.config.in - ./config.status + ./config.status --file $@ include Makefile.config +# Installing stuff. +define install-file-in = + + install:: $(1)/$(notdir $(2)) + + $(1)/$(notdir $(2)): $(2) + install -d $(1) + install -t $(1) $(2) + +endef + + # Include all sub-Makefiles. define include_sub_makefile = d := $$(patsubst %/, %, $$(dir $(1))) diff --git a/corepkgs/Makefile.new b/corepkgs/Makefile.new new file mode 100644 index 000000000..d20847825 --- /dev/null +++ b/corepkgs/Makefile.new @@ -0,0 +1,3 @@ +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-file-in,$(datadir)/nix/corepkgs,$(d)/$(file))))