aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-02-14 15:46:15 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-02-14 15:46:15 +0100
commit3d216bd6797bc4bf0d02cd43adf37706b057c580 (patch)
tree5f3be80a234172f63df65790507fe38f09edb37f /reproduce/src
parentd26535d6665879f77d39e790b4aa9ee0dcb63dcf (diff)
Symbolic link to build directory now permanently added
Managing this symbolic link as a prerequisite that may or maynot be defined just made the code too dirty. It is almost always needed, so it is now a super-high-level prerequisite (first dependency of the `all' target, even before the final PDF). In this way, we can be sure it is always built and that nothing else depends on it. If the user doesn't want it, they can simply remove it from the top `Makefile'.
Diffstat (limited to 'reproduce/src')
-rw-r--r--reproduce/src/make/initialize.mk45
1 files changed, 21 insertions, 24 deletions
diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk
index 927c292..7c272d5 100644
--- a/reproduce/src/make/initialize.mk
+++ b/reproduce/src/make/initialize.mk
@@ -36,7 +36,6 @@
texdir = $(BDIR)/tex
srcdir = reproduce/src
lockdir = $(BDIR)/locks
-bdirsym = reproduce/build
mtexdir = $(texdir)/macros
gconfdir = reproduce/config/gnuastro
pconfdir = reproduce/config/pipeline
@@ -100,6 +99,26 @@ $(texdir) $(lockdir): | $(BDIR); mkdir $@
+# Symbolic link to build directory
+# --------------------------------
+#
+# Besides $(BDIR), we are also making a symbolic link to it for easy
+# access. Recall that it is recommended that the actual build directory be
+# in a completely separate part of the file system (a place that may easily
+# be completely deleted).
+#
+# Note that $(BDIR) might not be an absolute path and this will complicate
+# the symbolic link creation. To be generic, we'll first call `readlink' to
+# make sure we have an absolute address, then we'll make a symbolic link to
+# that.
+reproduce/build: | $(BDIR)
+ absbdir=$$(readlink -f $(BDIR)); \
+ ln -s $$absbdir $@
+
+
+
+
+
# High-level Makefile management
# ------------------------------
#
@@ -115,7 +134,7 @@ clean:
ifeq ($(configure-run),yes)
rm -rf $(BDIR)
endif
- rm -f $(bdirsym) $(gconfdir)/mmap* *.pdf *.log *.out *.aux *.auxlock
+ rm -f reproduce/build $(gconfdir)/mmap* *.pdf *.log *.out *.aux *.auxlock
@@ -140,25 +159,3 @@ $(mtexdir)/initialize.tex: | $(mtexdir)
# Location of the build directory (for LaTeX inputs).
@echo "\newcommand{\bdir}{$(BDIR)}" >> $@
-
-
-
-
-
-# Symbolic link to build directory
-# --------------------------------
-#
-# Besides $(BDIR), we are also making a symbolic link to it if $(bdirsym)
-# is not empty. In case this symbolic link is not needed, simply remove its
-# value from the definitions above. In that case, it will be read as a
-# blank (non-existant).
-#
-# Note that $(BDIR) might not be an absolute path and this will complicate
-# the symbolic link creation. To be generic, we'll first call `readlink' to
-# make sure we have an absolute address, then we'll make a symbolic link to
-# that.
-ifneq ($(bdirsym),)
-$(bdirsym): | $(BDIR)
- absbdir=$$(readlink -f $(BDIR)); \
- ln -s $$absbdir $(bdirsym)
-endif