Commit 924ecd85 authored by Iustin Pop's avatar Iustin Pop

Change how we create the 'ganeti' symlink

Currently, if one runs 'make' in an already fully-built tree, this is
the result:

  cd . && test -h "ganeti" || { rm -f ganeti && ln -s lib ganeti; }
  make  all-am
  make[1]: Entering directory `/tmp/test'
  cd . && test -h "ganeti" || { rm -f ganeti && ln -s lib ganeti; }
  make[1]: Leaving directory `/tmp/test'

This is because commit dc7d2c49 added 'ganeti' (which is a PHONY
target) to BUILT_SOURCES, and since that is a dependency of other,
real targets, it means the ganeti target is always remade.

To fix this, we keep ganeti as a PHONY target, but we remove it from
the 'built_base_sources' target, and instead we only remake it
manually in the stamp-directories target. A make run now is just:

  make  all-am
  make[1]: Entering directory `/tmp/test'
  make[1]: Nothing to be done for `all-am'.
  make[1]: Leaving directory `/tmp/test'

Note that we can't get rid of the all-am since we use BUILT_SOURCES.

We also remove the comment of BUILT_SOURCES since it no longer depends
on PHONY targets.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 3735787e
......@@ -158,15 +158,12 @@ CLEANFILES = \
.hpc/*.mix htools/*.tix \
doc/hs-lint.html
# BUILT_SOURCES should only be used as a dependency on phony
# targets. Otherwise it'll cause the target to rebuild every time.
BUILT_SOURCES = \
$(built_base_sources) \
$(BUILT_PYTHON_SOURCES) \
$(PYTHON_BOOTSTRAP)
built_base_sources = \
ganeti \
stamp-directories \
stamp-srclinks
......@@ -1250,6 +1247,7 @@ $(HS_BUILT_TEST_HELPERS): Makefile
chmod u+x $@
stamp-directories: Makefile
$(MAKE) $(AM_MAKEFLAGS) ganeti
@mkdir_p@ $(DIRS) $(BUILDTIME_DIR_AUTOCREATE)
touch $@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment