aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make/Top-Makefile
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-11 19:09:21 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-12 00:34:19 +0000
commitb7e88b1bf82b936f8fe07c0c2c5f8621c2018f3a (patch)
treebfec9c7f8746ea1f0682fbf0fc56654b41672c9e /reproduce/src/make/Top-Makefile
parent595626499d20c6e3b297e72c90b5bd3f4d528e8a (diff)
Dependencies built at the start of the pipeline
To enable easy/proper reproduction of results, all the high-level dependencies are now built within the pipeline and installed in a fixed directory that is added to the PATH of the Makefile. This includes GNU Bash and GNU Make, which are then used to run the pipeline. The `./configure' script will first build Bash and Make within itself, then it will build All the dependencies are also built to be static. So after they are built, changing of the system's low-level libraries (like C library) won't change the tarballs. Currently the C library and C compiler aren't built within the pipeline, but we'll hopefully add them to the build process also. With this change, we now have full control of the shell and Make that will be used in the pipeline, so we can safely remove some of the generalities we had before.
Diffstat (limited to 'reproduce/src/make/Top-Makefile')
-rw-r--r--reproduce/src/make/Top-Makefile108
1 files changed, 108 insertions, 0 deletions
diff --git a/reproduce/src/make/Top-Makefile b/reproduce/src/make/Top-Makefile
new file mode 100644
index 0000000..5d94766
--- /dev/null
+++ b/reproduce/src/make/Top-Makefile
@@ -0,0 +1,108 @@
+# A ONE-LINE DESCRIPTION OF THE WHOLE PIPELINE
+#
+# Original author:
+# Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Contributing author(s):
+# Your name <your@email.address>
+# Copyright (C) 2018, Your Name.
+#
+# This Makefile is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This Makefile is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# A copy of the GNU General Public License is available at
+# <http://www.gnu.org/licenses/>.
+
+
+
+
+
+# Ultimate target of this pipeline
+# --------------------------------
+#
+# The final paper (in PDF format) is the main target of this whole
+# reproduction pipeline. So as defined in the Make paradigm, we are
+# defining it here.
+#
+# Note that if you don't have LaTeX to build the PDF, or generally are just
+# interested in the processing, you can skip create the final PDF creation
+# with `pdf-build-final' of `reproduce/config/pipeline/pdf-build.mk'.
+all: paper.pdf
+
+
+
+
+
+# Include specific Makefiles
+# --------------------------
+#
+# To keep things clean, managable and readable, each set of operations is
+# (and must be) classified (modularized) by context into separate
+# Makefiles: the more the better. They are included in this top-level
+# Makefile through the command below.
+#
+# To further help in readability, it is best to avoid including Makefiles
+# within any other Makefile. So in short, it is best that the `foreach'
+# loop below contains all the `reproduce/src/make/*.mk' files.
+#
+# IMPORTANT NOTE: order matters in the inclusion of the processing
+# Makefiles. As the pipeline grows, some Makefiles will probably define
+# variables/dependencies that others need. Therefore unlike the
+# `reproduce/config/pipeline/*.mk' Makefiles which only define low-level
+# variables (not dependent on other variables and contain no rules), the
+# high-level processing Makefiles are included through the `foreach' loop
+# below by explicitly requesting them in a specific order here.
+include reproduce/config/pipeline/*.mk
+include $(foreach f, initialize \
+ download \
+ delete-me \
+ paper \
+ , reproduce/src/make/$(f).mk)
+
+
+
+
+
+# LaTeX macros for paper
+# ----------------------
+#
+# The final report's PDF (final target of this reproduction pipeline) takes
+# variable strings from the pipeline. Those variables are defined as LaTeX
+# macros in `tex/pipeline.tex'. This file is thus the interface between the
+# pipeline scripts and the final PDF.
+#
+# Each of the pipeline steps will save their macros into their own `.tex'
+# file in the `$(mtexdir)' directory. Those individual macros are the
+# pre-requisite to `tex/pipeline.txt'. `tex/pipeline.tex' is thus a
+# high-level output and is defined in this top-most Makefile (and not
+# `reproduce/src/make/paper.mk'). This enables a clear demonstration of the
+# top-level dependencies clearly.
+#
+# Note that if you don't want the final PDF and just want the processing
+# and file outputs, you can remove the value of the `pdf-build-final'
+# variable in `reproduce/config/pdf-build.mk'.
+tex/pipeline.tex: $(foreach f, initialize \
+ download \
+ delete-me \
+ , $(mtexdir)/$(f).tex)
+
+ # If no PDF is requested, then just exit here.
+ifeq ($(pdf-build-final),)
+ @echo
+ @echo
+ @echo "-----"
+ @echo "Everything is OK until this point, but not building PDF."
+ @echo "To do so, give a value to the 'pdf-build-final' variable."
+ @echo "It is defined in 'reproduce/config/pipeline/pdf-build.mk'."
+ @echo
+ @exit 1
+endif
+
+ # Merge all the TeX macros that are prepared for building the PDF.
+ @cat $(mtexdir)/*.tex > $@