Skip to content

Commit 59e4b3e

Browse files
committed
configure: make sure ocamlbuild_config.ml is rebuilt/PHONY
The configuration file depends on the current git state, so we should build it at least as often as the user requests it with 'make configure'.
1 parent 6318427 commit 59e4b3e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,18 @@ beforedepend:: src/glob_lexer.ml
173173

174174
# The config file
175175

176-
configure: Makefile.config src/ocamlbuild_config.ml
176+
CONF_FILES=Makefile.config src/ocamlbuild_config.ml
177+
configure: $(CONF_FILES)
177178

178-
Makefile.config src/ocamlbuild_config.ml: configure.make
179+
$(CONF_FILES):
179180
$(MAKE) -f configure.make $@
180181

182+
.PHONY: $(CONF_FILES)
183+
181184
clean::
182-
rm -f Makefile.config src/ocamlbuild_config.ml
185+
rm -f $(CONF_FILES)
183186

184-
beforedepend:: src/ocamlbuild_config.ml
187+
beforedepend:: configure
185188

186189
# Installation
187190

configure.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ Makefile.config:
8383
echo "LIBDIR=$(OCAMLBUILD_LIBDIR)"; \
8484
) > $@
8585

86+
# the configuration file depends on the git environment,
87+
# so it should be rebuilt each time
88+
.PHONY: src/ocamlbuild_config.ml
89+
8690
src/ocamlbuild_config.ml:
8791
(echo "(* This file was generated from ../configure.make *)"; \
8892
echo ;\

0 commit comments

Comments
 (0)