Add a generic rule for installing files
This commit is contained in:
parent
c7547cff19
commit
4315acb8c0
2 changed files with 16 additions and 1 deletions
14
Makefile.lib
14
Makefile.lib
|
@ -3,11 +3,23 @@ default: all
|
||||||
|
|
||||||
# Include Autoconf variables.
|
# Include Autoconf variables.
|
||||||
Makefile.config: Makefile.config.in
|
Makefile.config: Makefile.config.in
|
||||||
./config.status
|
./config.status --file $@
|
||||||
|
|
||||||
include Makefile.config
|
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.
|
# Include all sub-Makefiles.
|
||||||
define include_sub_makefile =
|
define include_sub_makefile =
|
||||||
d := $$(patsubst %/, %, $$(dir $(1)))
|
d := $$(patsubst %/, %, $$(dir $(1)))
|
||||||
|
|
3
corepkgs/Makefile.new
Normal file
3
corepkgs/Makefile.new
Normal file
|
@ -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))))
|
Loading…
Reference in a new issue