diff options
| author | Kyle Russell <bkylerussell@gmail.com> | 2021-01-27 11:58:56 -0500 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-27 21:30:26 +0100 |
| commit | a8183270c91b098ad819f02f510945a400ebbc40 (patch) | |
| tree | c5e98042d2ff0af3316bd5b97a2cb865b23ac5f5 /Makefile | |
| parent | 0fb77bb6e5429575f52b5e26f06db031f93de057 (diff) | |
| download | sparse-dev-a8183270c91b098ad819f02f510945a400ebbc40.tar.gz | |
Makefile: fix version.h dependencies
This guarantees the generated version.h will exist before attempting
to compile any c files that include it.
Several source files include the generated version.h, but not all
declare a proper make dependency.
$ grep -r 'version\.h' *.c
compile-i386.c:#include "version.h"
lib.c:#include "version.h"
options.c:#include "version.h"
This allows a sufficiently parallelized make invocation to encounter
ENOENT.
CC compile-i386.o
compile-i386.c:60:21: fatal error: version.h: No such file or directory
compilation terminated.
Makefile:253: recipe for target 'compile-i386.o' failed
make: *** [compile-i386.o] Error 1
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
[luc.vanoostenryck@gmail.com: modified so that only version.c depends on version.h]
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -90,6 +90,7 @@ LIB_OBJS += target-xtensa.o LIB_OBJS += tokenize.o LIB_OBJS += unssa.o LIB_OBJS += utils.o +LIB_OBJS += version.o PROGRAMS := PROGRAMS += compile @@ -260,7 +261,7 @@ cflags += $($(*)-cflags) $(CPPFLAGS) $(CFLAGS) selfcheck: $(OBJS:.o=.sc) SPARSE_VERSION:=$(shell git describe --dirty 2>/dev/null || echo '$(VERSION)') -lib.o: version.h +version.o: version.h version.h: FORCE @echo '#define SPARSE_VERSION "$(SPARSE_VERSION)"' > version.h.tmp @if cmp -s version.h version.h.tmp; then \ |
