From b8e39ac5e48ffd447acef8dc7976a462fd762afc Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 31 Jul 2015 13:24:39 -0400 Subject: [PATCH 1/2] build: don't use BUILT_SOURCES for the static context header BUILT_SOURCES simply forces the header to be built first. Use real dependencies instead. This fixes builds with dependency tracking disabled where a real target is specified. As a bonus, this also fixes the issue of gen_context and the header not being rebuilt when gen_context.c is touched. --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 2609c7f..0147418 100644 --- a/Makefile.am +++ b/Makefile.am @@ -86,7 +86,8 @@ gen_%.o: src/gen_%.c gen_context$(BUILD_EXEEXT): $(gen_context_OBJECTS) $(CC_FOR_BUILD) $^ -o $@ -BUILT_SOURCES = src/ecmult_static_context.h +$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h +$(tests_OBJECTS): src/ecmult_static_context.h src/ecmult_static_context.h: gen_context ./gen_context From e4ce39368334b488aec12cb9f9613bcad6b2a4e8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 31 Jul 2015 13:33:58 -0400 Subject: [PATCH 2/2] build: fix hard-coded usage of "gen_context" The binary needs an extension on some platforms. --- Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0147418..0256cc5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,20 +79,20 @@ CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)/ CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function gen_context_OBJECTS = gen_context.o - +gen_context_BIN = gen_context$(BUILD_EXEEXT) gen_%.o: src/gen_%.c $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@ -gen_context$(BUILD_EXEEXT): $(gen_context_OBJECTS) +$(gen_context_BIN): $(gen_context_OBJECTS) $(CC_FOR_BUILD) $^ -o $@ $(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h $(tests_OBJECTS): src/ecmult_static_context.h -src/ecmult_static_context.h: gen_context - ./gen_context +src/ecmult_static_context.h: $(gen_context_BIN) + ./$(gen_context_BIN) -CLEANFILES = gen_context src/ecmult_static_context.h +CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h endif EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h