* builds/toplevel.mk: Prefix all paths with `$(TOP_DIR)/`. This is useful for builds that are not started from the root directory. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index b1da290..083aa41 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -139,12 +139,12 @@ ifdef check_platform
ifneq ($(is_unix),)
distclean:
- $(RM) builds/unix/config.cache
- $(RM) builds/unix/config.log
- $(RM) builds/unix/config.status
- $(RM) builds/unix/unix-def.mk
- $(RM) builds/unix/unix-cc.mk
- $(RM) builds/unix/freetype2.pc
+ $(RM) $(TOP_DIR)/builds/unix/config.cache
+ $(RM) $(TOP_DIR)/builds/unix/config.log
+ $(RM) $(TOP_DIR)/builds/unix/config.status
+ $(RM) $(TOP_DIR)/builds/unix/unix-def.mk
+ $(RM) $(TOP_DIR)/builds/unix/unix-cc.mk
+ $(RM) $(TOP_DIR)/builds/unix/freetype2.pc
$(RM) nul
endif # test is_unix
@@ -170,17 +170,17 @@ endif # test check_platform
check_out_submodule:
$(info Checking out submodule in `subprojects/dlg')
- git submodule init
- git submodule update
+ git --git-dir=$(TOP_DIR) submodule init
+ git --git-dir=$(TOP_DIR) submodule update
copy_submodule:
$(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
- ifeq ($(wildcard include/dlg),)
- mkdir $(subst /,$(SEP),include/dlg)
+ ifeq ($(wildcard $(TOP_DIR)/include/dlg),)
+ mkdir $(subst /,$(SEP),$(TOP_DIR)/include/dlg)
endif
- $(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)
+ $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/output.h $(TOP_DIR)/include/dlg)
+ $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/dlg.h $(TOP_DIR)/include/dlg)
+ $(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/src/dlg/dlg.c $(TOP_DIR)/src/dlg)
# We always need the list of modules in ftmodule.h.
@@ -294,15 +294,15 @@ CHANGELOG_SCRIPT = ~/git/config/gitlog-to-changelog
do-dist: distclean refdoc
@# Without removing the files, `autoconf' and friends follow links.
- rm -f builds/unix/aclocal.m4
- rm -f builds/unix/configure.ac
- rm -f builds/unix/configure
+ rm -f $(TOP_DIR)/builds/unix/aclocal.m4
+ rm -f $(TOP_DIR)/builds/unix/configure.ac
+ rm -f $(TOP_DIR)/builds/unix/configure
sh autogen.sh
- rm -rf builds/unix/autom4te.cache
+ rm -rf $(TOP_DIR)/builds/unix/autom4te.cache
- cp $(CONFIG_GUESS) builds/unix
- cp $(CONFIG_SUB) builds/unix
+ cp $(CONFIG_GUESS) $(TOP_DIR)/builds/unix
+ cp $(CONFIG_SUB) $(TOP_DIR)/builds/unix
@# Generate `ChangeLog' file with commits since release 2.11.0
@# (when we stopped creating this file manually).
@@ -313,10 +313,10 @@ do-dist: distclean refdoc
> ChangeLog
@# Remove intermediate files created by the `refdoc' target.
- rm -rf docs/markdown
- rm -f docs/mkdocs.yml
+ rm -rf $(TOP_DIR)/docs/markdown
+ rm -f $(TOP_DIR)/docs/mkdocs.yml
@# Remove more stuff related to git.
- rm -rf subprojects/dlg
+ rm -rf (TOP_DIR)/subprojects/dlg
# EOF