summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-06-11 15:08:51 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-06-12 12:43:26 +0200
commited04306eca56202a7fae708a6eead0c94c0df42b (patch)
tree2f34f8a2cf73a9f00a6180f5aa532ded4c47bcab
parenta3e75f329446a93a61ca4c458a7657bd919f4fe6 (diff)
downloadNetworkManager-ed04306eca56202a7fae708a6eead0c94c0df42b.tar.gz
build: only update config-extra.h if it changeslr/config-extra-h
This is to avoid updating config-extra.h timestamp very time one touches Makefile.am, because it has a large dependency chain and makes debugging of the Makefile inconvenient.
-rw-r--r--Makefile.am38
1 files changed, 19 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am
index 929d4ba1b8..d0e4ec3786 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,25 +111,25 @@ dflt_cppflags = -std=gnu11
# With meson-only, they could just be set via config.h.meson
config-extra.h: Makefile
$(AM_V_GEN) \
- echo "/* Generated by Makefile.am */" >$@ && \
- echo "#define BINDIR \"$(bindir)\"" >>$@ && \
- echo "#define DATADIR \"$(datadir)\"" >>$@ && \
- echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@ && \
- echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@ && \
- echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@ && \
- echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@ && \
- echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@ && \
- echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@ && \
- echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@ && \
- echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@ && \
- echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@ && \
- echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@ && \
- echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@ && \
- echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
- echo "#define PREFIX \"$(prefix)\"" >>$@ && \
- echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \
- echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \
- true
+ echo "/* Generated by Makefile.am */" >$@.tmp && \
+ echo "#define BINDIR \"$(bindir)\"" >>$@.tmp && \
+ echo "#define DATADIR \"$(datadir)\"" >>$@.tmp && \
+ echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@.tmp && \
+ echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@.tmp && \
+ echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@.tmp && \
+ echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@.tmp && \
+ echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@.tmp && \
+ echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@.tmp && \
+ echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@.tmp && \
+ echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@.tmp && \
+ echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@.tmp && \
+ echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@.tmp && \
+ echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@.tmp && \
+ echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@.tmp && \
+ echo "#define PREFIX \"$(prefix)\"" >>$@.tmp && \
+ echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@.tmp && \
+ echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@.tmp && \
+ if cmp $@ $@.tmp; then rm $@.tmp; else mv $@.tmp $@; fi
DISTCLEANFILES += config-extra.h