Makefile: add -Wshadow=local, fix configurator! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: fix compile after rbuf rewrite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: Fix asort multiple definition error Error I experienced on Alpine Linux without this patch: In file included from ccan/generator/generator.c:8:0: ./ccan/generator/generator.h:23:2: error: #error Generators require coroutines #error Generators require coroutines ^~~~~ make: *** [Makefile:32: ccan/generator/generator.o] Error 1
tools: Add asort module tools/manifest.c uses asort(), but the asort module is not in TOOLS_CCAN_MODULES. That causes compile failures on some platforms, so correct it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: fix fastcheck. commit 25b7406d11ea3703be864097af66ce95611dde72 tried to make the tests depend on the info file, but that broke .fast.ok, which used the same pattern: %.ok: $(LINT) %info This is what happens when you're too tricky! Simply duplicate the rule, and change .fast.ok to .fast-ok so it doesn't match both. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: Allow path to gcov to be overriden Currently ccanlint always assumes that the coverage tool can be invoked under the command "gcov". However, the coverage tool generally needs to be closely matched to the compiler version. So, the current behaviour won't work with compilers other than gcc, like clang. It won't even work for a gcc version which isn't the standard system one matching gcov. To address this, allow the command for the coverage tool to be overridden on the ccanlint command line with a new --gcov option. We also allow it to be overridden for make check with a GCOV make variable. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: Make module checks depend on info file Changing the _info file can change how ccanlint assesses the module. Therefore, if the _info file changes, we should re-run ccanlint module tests with make check. We didn't previously have a dependency for that, though, so this adds it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: Remove unused test targets The Makefile provides for "fast" and "full" variants of make check. However, nothing seems to use or implement the "full" variant at all. Further, the %.check and %.fastcheck targets are not actually used, with other targets instead using the actual .ok tag file as the target. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: Remove generator modules from the exclude list There's no real reason to exclude 'generator' from the build or check targets. Add it back in. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Merge Makefile rewrite into master # Conflicts: # .travis.yml # Makefile # Makefile-ccan
Makefile: Define CFLAGS_FORCE_C_SOURCE macro This macro holds the C compiler flag(s) to force input files to be recognized as C sources regardless of extension. It is defined to allow overriding on the make command line. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: First try at rewriting the ccan Makefile. This change contains a simpler Makefile replacement with only 62 lines of directives, 10 rules, and a 13 line support script for dependencies. The build dependencies have been minimised and in some cases, corrected. FEATURES: * All targets can be built from a clean tree in one invocation. * Parallel builds (tested with -j32 on 8 cores). * Auto discovery of modules via _info files. * Hopefully complete dependencies via a simplified generator. * CFLAGS are respected and appended to compile flags. * LINTFLAGS can be set to add check options (e.g. LINTFLAGS=-v). * 'make clean' doesn't build anything before cleaning now. * 'make quiet=1' builds quietly. 'make check quiet=1 -j N' produces summary output like the former summary target. * Non-phony test targets; tests are rebuilt only when dirty. Targets are: check, fastcheck and fullcheck, the latter runs in non-summary mode. * 'make <module>.[check|fastcheck|fullcheck]' runs tests for single modules. TODO: * Support Makefile-web and any other scattered targets NOTES: * The changes to dependency generation expose a circular dependency between asort and order which is not fixed here. * Tests always run their dependent tests. With -j support and minimised rebuilds via tighter dependencies, its not worth avoiding. * Some targets have been dropped as uneeded (e.g. distclean, tools). Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Build info files All modules have a _info file (a C file, despite the lack of extension) giving metadata for the module. The Makefiles have a rule to build these.. but it's broken (missing an include directive). This patch fixes the rule, and builds the info binaries for all modules by default. This is a useful check and also useful for manually inspecting a module's metadata. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: exclude altstack so Jenkins works again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Clean up use of 'rm' in Makefiles Most of the ccan Makefiles use $(RM) to remove files. However, 'rm' is traditionally considered one of the few shell tools which can be used in Makefiles without indirecting via a variable. rm is also typically invoked with -f in Makefiles, so that it doesn't cause errors if the files don't exist (because they haven't been built). A number of instances in ccan were missing this. This corrects these warts. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Add missing files to make clean At present, "make clean" will not remove the module-Makefile files for non-top-level modules. It also won't remove the generated config.h. Correct those errors. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Makefile: add altstack and generator to build exclusions. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: fix random pattern hack. Turns out that patterns with / cause % to match /. OK... Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: more hacks for crypto/ and str/ subdirs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: don't separate all modules with external dependencies. Using ccanlint's --deps-fail-ignore, we can just test every module with "make check". Still exclude them from the 'libccan.a' build though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>