File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -173,15 +173,28 @@ beforedepend:: src/glob_lexer.ml
173173
174174# The config file
175175
176- configure : Makefile.config src/ocamlbuild_config.ml
177-
178- Makefile.config src/ocamlbuild_config.ml : configure.make
176+ # we mark only the 'configure' rule PHONY,
177+ # not individual CONF_FILES, as all OCamlbuild
178+ # sources depend on ocamlbuild_config.ml,
179+ # so it would rebuild from scratch each time.
180+ #
181+ # The reason for marking PHONY is to let the user
182+ # explicitly re-configure; the --version answer
183+ # depends on the state of the git repository, so
184+ # it may change at any time.
185+ .PHONY : configure
186+
187+ CONF_FILES =Makefile.config src/ocamlbuild_config.ml
188+ configure :
189+ $(MAKE ) -f configure.make $(CONF_FILES )
190+
191+ $(CONF_FILES ) :
179192 $(MAKE ) -f configure.make $@
180193
181194clean ::
182- rm -f Makefile.config src/ocamlbuild_config.ml
195+ rm -f $( CONF_FILES )
183196
184- beforedepend :: src/ocamlbuild_config.ml
197+ beforedepend :: Makefile.config
185198
186199# Installation
187200
Original file line number Diff line number Diff 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+
8690src/ocamlbuild_config.ml :
8791 (echo " (* This file was generated from ../configure.make *)" ; \
8892 echo ; \
You can’t perform that action at this time.
0 commit comments