Issue444

Title Use = ,?=, += and := consistently in Makefile
Priority wish Status resolved
Superseder Nosy List florian, malte
Assigned To florian Keywords
Optional summary

Created on 2014-07-24.01:52:32 by florian, last changed by florian.

Messages
msg3234 (view) Author: florian Date: 2014-07-24.16:34:17
Merged.
msg3233 (view) Author: malte Date: 2014-07-24.16:14:05
Looks good to me. (I've made a few minor comments.) If it works, feel free to
merge. :-)
msg3232 (view) Author: florian Date: 2014-07-24.16:04:22
Ok, I created a pull-request on Bitbucket. Once we merge this I'll send out an
email to the list to announce this change and issue429.
msg3226 (view) Author: malte Date: 2014-07-24.10:17:55
Looks good.

OS is documented as a user-settable variable (to override cases where automatic
detection fails), so should be DOWNWARD_OS.

The starting point for all this was that people wanted to override some
variables like CXX and DEPEND to build Fast Downward with a non-system C++
compiler. Maybe we should permit setting these via the environment, too, for
consistency. I think we could simply achieve this by not setting CXX at all
(since there should be a built-in Make variable by that name that defaults to
g++) and by defining DEPEND in terms of CXX rather than setting it directly.

(I don't think having variables like DOWNWARD_CXX etc. for these would be a good
idea; it goes against common Linux practice.)
msg3225 (view) Author: florian Date: 2014-07-24.01:52:32
There are subtle differences in the semantic of different assignments
(http://stackoverflow.com/questions/448910/makefile-variable-assignment). We
should use ?= only for variables that can be set up as environment variables, :=
only for the results of shell evaluations and = everywhere else. With += not all
variables are initialized to be empty. Variables that can be environment
variables should use the prefix "DOWNWARD_" and should be documented.

We currently use the following variables with the following assignments
(suggestions in parantheses):
BITWIDTH ?= (change to DOWNWARD_BITWIDTH ?=)
USE_LP = (change to DOWNWARD_USE_LP ?=)
CPLEX_INCDIR ?= (change to DOWNWARD_CPLEX_INCDIR ?=)
CPLEX_LIBDIR ?= (change to DOWNWARD_CPLEX_LIBDIR ?=)
GUROBI_INCDIR ?= (change to DOWNWARD_GUROBI_INCDIR ?=)
GUROBI_LIBDIR ?= (change to DOWNWARD_GUROBI_LIBDIR ?=)
COIN_ROOT ?= (change to DOWNWARD_COIN_ROOT ?=)
LINK_RELEASE_STATICALLY = (change to DOWNWARD_LINK_RELEASE_STATICALLY ?=)
COIN_HAS_CPX = (change to COIN_HAS_CPX :=)
COIN_LIBS += (initialize to be empty)
COIN_CXXFLAGS += (initialize to be empty)
COIN_LDFLAGS += (initialize to be empty)
COIN_HAS_GUROBI = (change to COIN_HAS_GUROBI :=)

OS =
HEADERS =/+=
SOURCES =
TARGET =
ARGS_PROFILE =
SHELL =
UNAME :=
UNAME_O :=
OBJECT_SUFFIX_RELEASE =
TARGET_SUFFIX_RELEASE =
OBJECT_SUFFIX_DEBUG =
TARGET_SUFFIX_DEBUG =
OBJECT_SUFFIX_PROFILE =
TARGET_SUFFIX_PROFILE =
CXX =
DEPEND =
BITWIDTHOPT =
CXXFLAGS =/+=
HAVE_GCC_4_4 :=
HAVE_GCC_4_5 :=
LDFLAGS =/+=
POSTLINKOPT =
CXXFLAGS_RELEASE =
CXXFLAGS_DEBUG =
CXXFLAGS_PROFILE =
LDFLAGS_RELEASE =/+=
LDFLAGS_DEBUG =
LDFLAGS_PROFILE =
POSTLINKOPT_RELEASE =/+=
POSTLINKOPT_DEBUG =/+=
POSTLINKOPT_PROFILE =/+=
History
Date User Action Args
2014-07-24 16:34:17floriansetstatus: chatting -> resolved
messages: + msg3234
2014-07-24 16:14:05maltesetmessages: + msg3233
2014-07-24 16:04:22floriansetmessages: + msg3232
2014-07-24 10:17:55maltesetmessages: + msg3226
2014-07-24 01:52:32floriancreate