* builds/toplevel.mk: Use rules for handling 'dlg'. Suggested by Alexei. (check_out_submodule, copy_submodule): New targets. <top-level>: Replace calls to `shell` with rules.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/ChangeLog b/ChangeLog
index a191af7..cd4d7d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2021-02-16 Werner Lemberg <wl@gnu.org>
+ * builds/toplevel.mk: Use rules for handling 'dlg'.
+
+ Suggested by Alexei.
+
+ (check_out_submodule, copy_submodule): New targets.
+ <top-level>: Replace calls to `shell` with rules.
+
+2021-02-16 Werner Lemberg <wl@gnu.org>
+
* builds/toplevel.mk: Avoid side effects of `shell`.
We use a dummy variable to catch its output. Otherwise the `make`
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index e9cb62d..d9de414 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -103,6 +103,22 @@ ifneq ($(findstring setup,$(MAKECMDGOALS)),)
check_platform := 1
endif
+
+.PHONY: check_out_submodule copy_out_submodule
+
+check_out_submodule:
+ $(info Checking out submodule in `subprojects/dlg')
+ git submodule init
+ git submodule update
+
+copy_submodule:
+ $(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
+ mkdir $(subst /,$(SEP),include/dlg) $(NO_OUTPUT)
+ $(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/output.h include/dlg)
+ $(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/dlg.h include/dlg)
+ $(COPY) $(subst /,$(SEP),subprojects/dlg/src/dlg/dlg.c src/dlg)
+
+
# Include the automatic host platform detection rules when we need to
# check the platform.
#
@@ -117,19 +133,10 @@ ifdef check_platform
#
ifeq ($(wildcard src/dlg/dlg.*),)
ifeq ($(wildcard subprojects/dlg/*),)
- $(info Checking out submodule in `subprojects/dlg')
- dummy := $(shell git submodule init)
- dummy := $(shell git submodule update)
+ copy_submodule: check_out_submodule
endif
- $(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
- dummy := $(shell mkdir $(subst /,$(SEP),include/dlg) $(NO_OUTPUT))
- dummy := $(shell $(COPY) \
- $(subst /,$(SEP),subprojects/dlg/include/dlg/output.h include/dlg))
- dummy := $(shell $(COPY) \
- $(subst /,$(SEP),subprojects/dlg/include/dlg/dlg.h include/dlg))
- dummy := $(shell $(COPY) \
- $(subst /,$(SEP),subprojects/dlg/src/dlg/dlg.c src/dlg))
+ setup: copy_submodule
endif
# This rule makes sense for Unix only to remove files created by a run of