[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Circular dependency with order-only dependencies
From: |
Edward Welbourne |
Subject: |
Re: Circular dependency with order-only dependencies |
Date: |
Thu, 24 Jan 2019 10:16:01 +0000 |
Eli Zaretskii (23 January 2019 20:21)
> In Emacs, we have a header file that is generated from an certain data
> file, but its generation requires an Emacs binary, which runs a Lisp
> command to massage the data file into a C header. And the binary
> depends on that header because one of the source files #include's the
> header. The header is also kept in the VCS, so some, perhaps outdated
> version of it is always available. But I cannot find a way of having
> a target that remakes the header when the data file changes, because
> this creates a circular dependency which Make throws away.
A suggestion for a kludge-around for this: part of your make-file says
how to regenerate the header from the data file, using an emacs binary.
Condition that part of your make-file on existence of the emacs binary.
ifneq ($(wildcard $(BINARY)),)
generated.h: source.txt # but don't overtly depend on $(BINARY) !
$(BINARY) ... command ...
endif
(Overt dependence on $(BINARY) would make your graph cyclic.)
Not pretty, but hopefully it can be made to work,
Eddy.