Commit Graph

41 Commits

Author SHA1 Message Date
Christophe de Dinechin 0ae490d5fd Add results from pkg-config to config.h 2018-04-12 12:39:36 +02:00
Christophe de Dinechin 87ba839cdd Simplify rules for the dependencies 2018-04-10 18:56:25 +02:00
Christophe de Dinechin e7c15a35ae Add better libtool support in config.gnu.mk
When LIBTOOL is set, then we use libtool all the way.
Otherwise, we manually perform the compile/link stages.
2018-04-10 18:40:00 +02:00
Christophe de Dinechin 2bcd0c9bcf Makefile rules refactoring - MIQ namespace + solidity
A number of changes in this commit:

1. Variable namespace cleanup:
   Rename non-configurable variables as MIQ_XYZ.

2. Internal target namespace cleanup
   Rename intermediate targets to begin with a dot (.)
   For example .build, .prebuild, etc.
   This impacts makefiles that hook for example to prebuild
   (now they need to hook to the .prebuild target)

3. Target, variant and build-environment variables names
   For example, dependencies on $(TARGET) moved from DEFINES_xyz
   to DEFINES_TARGET_xyz instead of DEFINES_xyz, and same thing
   for includes, sources, etc.

4. Protection of special user-level top-level targets
   A target like log-% no longer interferes with a file name such
   as log-file.c

5. Better support for multiple products
   When building foo.exe and bar.lib, there can be different
   sources for each project, i.e. $(SOURCES_foo) and $(SOURCES_bar).
2018-04-10 18:37:27 +02:00
Christophe de Dinechin 198ad6420d Change project name to 'Make-it-Quick', and make it installable
This simplifies the management of projects using make-it-quick by
putting the makefile include files in a shared location
(typically /usr/local/include/make-it-quick)
2018-04-04 10:32:09 +02:00
Christophe de Dinechin 4d77ac826f Copyright update for 2018 2018-04-04 10:31:11 +02:00
Christophe de Dinechin 5d385379e2 Avoid a warning with -fPIC on MinGW 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 37f7dc4f9d Make sure that LDFLAGS are set when running configuration steps
This is necessary for example when specific flags are required to
find a library in a configuration rule, e.g. LDFLAGS=/some/path
2018-04-04 10:21:04 +02:00
Christophe de Dinechin c1cc66ade3 Add -Wl,-rpath option to standard GNU ld
(This differs from macOS where -rpath is a gcc driver option)
2018-04-04 10:21:04 +02:00
Christophe de Dinechin 472c390157 Put the /dev/null in $(CAT)
Also do not build library checks with $(CFG_CFLAGS), because they are
neither needed nor available at that point.
2018-04-04 10:21:04 +02:00
Christophe de Dinechin 4d5957d73d Fix test environment TEST_ENV for `make test` 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 00942dc77a Restrict variable names when transforming cfg.h into cfg.mk 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 96d1e61a61 Better install process 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 49adc492f5 Do not add LDFLAGS when building static libraries 2018-04-04 10:21:04 +02:00
Christophe de Dinechin cb6b38ad72 Extract link libraries from CONFIG libX entries 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 7f5780099c Add -fPIC to standard flags 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 24eff2112b Workaround a bug in GNU make when reloading generated makefiles
The problem was discovered testing parallel builds.
The configuration rules depend on generated pkg-config.mk files.
However, experimentally, variables set in these files are not
correctly reloaded in rules declared in other variables.

Specifically, $(CFLAGS_PKGCONFIG) was not re-expanded after being
modified, which led to configuration builds to lack the required
flags, causing false configuration step failures.

The flags are now explicitly listed using $(shell cat...), which
is a little bit more expensive during the configuration step, but
ensures that the flags are correctly seen. Note that at that stage,
the dependency ensures that all the files were built correctly.
2018-04-04 10:21:04 +02:00
Christophe de Dinechin 6dd72b3adb For configuration compiles, delay evaluation of CFLAGS, add LDFLAGS 2018-04-04 10:21:04 +02:00
Christophe de Dinechin bcdde51bf5 Reorganize configuration management for readability 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 40b5b90342 Fix typo in CFLAGS for configuration builds 2018-04-04 10:21:04 +02:00
Christophe de Dinechin 0f3b5d325a Expose configuration variables to makefile 2018-04-04 10:21:03 +02:00
Christophe de Dinechin 99de9424db Restore the passing of LDFLAGS when building libraries 2018-04-04 10:21:03 +02:00
Christophe de Dinechin e209890343 Use -Lpath -llib for libraries
Avoid referencing libraries by absolute path, which is not very portable
2018-04-04 10:21:03 +02:00
Christophe de Dinechin 6a9ad13412 Make it simpler to mix static and shared libraries
Also avoid using libtool -shared, not available by default on many platforms
2018-04-04 10:21:03 +02:00
Christophe de Dinechin 391ecd8ff8 Link with ld if no C++ sources, closes GitHub #6 2018-04-04 10:21:03 +02:00
Christophe de Dinechin 131463c503 Add arm-linux-gnu cross-compiler support
(No support for selecting include and library path yet)
2018-04-04 10:21:03 +02:00
Christophe de Dinechin 4cabbde4b4 Change the way standard conformance is specified 2018-04-04 10:20:57 +02:00
Christophe de Dinechin 11093b9e66 Facilitate the creation of cross-compilation config.cross-gcc.mk
In order to create such a variant, you only need to override CC and CXX.
2018-04-04 10:20:15 +02:00
Christophe de Dinechin 93d13f8ecd File name mangling when building configuration steps
This is to avoid problems on Windows, where a file name cannot
contain < or > and as a result, tests for HAVE_<unistd.h> failed.
2018-04-04 10:20:15 +02:00
Christophe de Dinechin 11393dc8af Make sure we find configuration checks in build directory 2018-04-04 10:20:15 +02:00
Christophe de Dinechin 0f1266d53b Append output of executing the test program, so that we can add other #define's
The sbrk example shows the result of sbrk(0) first run.
2018-04-04 10:20:15 +02:00
Christophe de Dinechin 5ee5fafc3f Some factorization 2018-04-04 10:20:15 +02:00
Christophe de Dinechin 26dedc59e1 Check for library presence 2018-04-04 10:20:15 +02:00
Christophe de Dinechin 3293ab17f8 Link and execute the test program for completeness 2018-04-04 10:20:15 +02:00
Christophe de Dinechin 0a88f02d71 Add check for functions using a configuration file check 2018-04-04 10:20:15 +02:00
Christophe de Dinechin a1f04b6cf4 Separate configuration generation rules in config.arch.mk 2018-04-04 10:19:40 +02:00
Christophe de Dinechin 28c8dda7c6 Single-pass dependency generation 2018-04-04 10:19:40 +02:00
Christophe de Dinechin 649859601c Leave debug information for opt builds 2018-04-04 10:19:40 +02:00
Christophe de Dinechin c745b4411b Use GNU extensions also for C++11 2018-04-04 10:19:39 +02:00
Christophe de Dinechin b80031f737 Activate standard C++11, not older standard 2018-04-04 10:19:39 +02:00
Christophe de Dinechin 1c3c0e606c Initial state 2018-04-04 10:19:24 +02:00