Export the values of the following variables in the main makefile,
avoiding the need to pass through each one to child make processes
manually:
CFLAGS
CXXFLAGS
LDFLAGS
JFLAGS
LIBPREFIX
LIBSUFFIX
In the top-level makefile, CFLAGS is defined in terms of CUDD_XCFLAGS on
every OS and architecture; the only difference between them is that
CFLAGS incorporates the value of OPTIMISE, whereas CUDD_XCFLAGS doesn't.
This is because the CUDD makefile draws a distinction between
"machine-independent flags" (ICFLAGS) and "machine-dependent flags"
(XCFLAGS), and the optimisation level is a machine-independent flag. The
same is true of DEBUG (-g) and WARNINGS (-Ox), but for some reason they
aren't treated the same way as OPTIMISE.
Rather than defining CFLAGS in terms of CUDD_XCFLAGS, do the following:
* define CFLAGS directly;
* remove CUDD_XCFLAGS;
* define ICFLAGS and XCFLAGS in the CUDD-related targets in terms of the
relevant flags in CFLAGS - i.e., extract the values (if any) of DEBUG,
OPTIMISE and WARNINGS from CFLAGS and pass them to the CUDD makefile
as ICFLAGS, and whatever's left as XCFLAGS.
This will also help to standardise the compiler flags used across all
the libraries (e.g., currently CUDD is compiled with -g but nothing else
is).
The use of $(filter-out) means that weird things might happen if DEBUG,
OPTIMISE or WARNINGS ever contain % symbols, but this (hopefully) isn't
likely...
The CC, CXX and JAVACC makefile variables are all redefined in the
"compiler flags" section of the makefile, which makes them easy to miss.
Define them in the "compilers" section instead.
Export the values of the following standard compiler and compiler flag
variables in the main makefile, avoiding the need to pass through each
one to child make processes manually:
CC
CXX
LD
JAVAC
JAVACC
Since JAVAC is manually exported as "$(JAVAC) $(JFLAGS)" by the main
makefile, additionally separate JAVAC and JFLAGS into separate variables
from the perspective of child make processes.
Rename the following makefile variables to their standard implicit
equivalents in GNU Make for the sake of clarity:
C -> CC
CPP -> CXX
CPPFLAGS -> CXXFLAGS
Rather than overriding the default path to the PRISM source directory by
setting the PRISM_SRC_DIR environment variable, do so by supplying an
argument to the script.
Rename the following makefile variables for the sake of clarity in child
makefiles:
SRC_DIR -> PRISM_SRC_DIR
CLASSES_DIR -> PRISM_CLASSES_DIR
OBJ_DIR -> PRISM_OBJ_DIR
LIB_DIR -> PRISM_LIB_DIR
INCLUDE_DIR -> PRISM_INCLUDE_DIR
IMAGES_DIR -> PRISM_IMAGES_DIR
DTDS_DIR -> PRISM_DTDS_DIR
The helper script src/scripts/printversion.sh also makes use of the
value of SRC_DIR exported from the main makefile, so use PRISM_SRC_DIR
in that script too.
Move release building automation from top-level Makefile to main
PRISM Makefile and delete the top-level one: after switching to git,
the required top-level directories (prism-examples, cudd, etc.) are
always present and there is no need for the separation.
Source releases will now be direct copies of the whole git repo. The Makefile
targets for building binary releases have been simplified and updates. They
are now triggered by "make release" or "make release VERSION=4.5".
There is also a new makefile target "doc" that currently pulls down a copy of
the online manual and stores it in the "manual" directory.
Create a new target "source-jar" that generates a JAR file containing
PRISM's .java, .form and .jj source files. This can be associated with
the regular JAR file in a Java IDE to more easily debug projects that
use PRISM's Java API.
In the "binary" target, parameterise the following directory names to
match the style used in other targets:
classes -> CLASSES_DIR
dtds -> DTDS_DIR (new variable)
images -> IMAGES_DIR (new variable)
lib -> LIB_DIR
src -> SRC_DIR
'testsfull' runs the test cases from prism-tests against all the
different engines (explicit, hybrid, sparse, mtbdd, exact), with and
without interval iteration and topological ordering, where appropriate.
As noted in #68, the javah tool has been removed in JDK10. Here, we switch to the new way of generating the JNI .h files, using the -h option of the regular javac compiler.
We have to adapt all Makefiles (not only those in directories that contain classes with native methods), as javac compiles all required classes (and generates their JNI headers) beyond the directory with the Makefile.
The .h files generated by javac -h had a different naming scheme, now there is a prefix for the package name. To avoid having to touch all the #includes, we generate the new .h files in prism/include/jni and provide legacy headers in the old location and with the old name, forwarding the the corresponding new header. In the future, at an appropriate moment, those legacy headers can be removed and replace with direct includes.
Currently, there is a post-processing step on Windows: After the .h file is generated, dos2unix is called to replace the Windows CRLF line endings. Otherwise, the generated headers show up as changed files in version control. As now there are no special targets for the generation of the .h files anymore, we move to a global post-processing step and call dos2unix on prism/include/jni/*.h at the end of building.
Now, all the top-level packages have Makefiles and search for Java files
in subpackages.
If a .java file does not get picked up by the Makefiles, it will
nonetheless be compiled if referenced from somewhere else in the
project, but dependency tracking at the level of 'make' is broken.
Currently, building PRISM with parallel building does not work,
as there are dependencies between targets that are not fully
encoded in the Makefiles. Building with -j n flag would lead to error.
Now, we add the .NOTPARALLEL target to most of the Makefiles,
which tell GNU make to ignore the -j flag. Note that this
only inhibits parallel builds for the current Makefile, we
thus have to specify it for all sub-Makefiles as well
(see https://www.gnu.org/software/make/manual/html_node/Parallel.html)
For the external libraries, CUDD and LPSolve don't seem to mind building
in parallel, so we don't inhibit there and can get some minor compile time
speed-up by using multiple cores if the -j option is specified.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@12202 bbc10eb1-c90d-0410-af57-cb519fbb1720
If lib/prism.jar exists (built by 'binary' target), it takes
precedence over newly compiled .class files. This is confusing, as
changing some sources, running 'make clean all' and then running PRISM
results in the "old" behaviour contained in lib/prism.jar.
Now, we remove lib/prism.jar on 'make clean'.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11789 bbc10eb1-c90d-0410-af57-cb519fbb1720