First version
[fnpdeploy.git] / deploy_setup / templates / supply-configuration.mk
1 # Makefile helper, supplying configuration files,
2 # defined as make prerequisites in the project's Makefile.
3 #
4 # For example, project's Makefile might say:
5 #
6 # deploy: src/core/local_settings.py
7 #       pip install ...
8 #       ...
9 #
10 # This file fulfills this prerequisite by looking for local_settings.py
11 # in the directory it sits in, and copying it to the needed location.
12 #
13 # This file expects to be used as:
14 #
15 #       make -C (release-dir) -f (path-to-this-file) ...
16 #
17 # and assumes there's a Makefile in the release directory.
18
19
20 HERE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
21
22
23 # This loads the Makefile from the release directory.
24 include Makefile
25
26
27 # Match any needed path, if we can find a matching file for it, and copy it.
28 .SECONDEXPANSION:
29 %: $(HERE)$$(notdir $$@)
30         cp $< $@
31
32
33 # Avoid circular rules.
34 $(HERE)%: 
35