From 6e3a9a2eda7c9492b7d49e82ff86ff5962494999 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 22 Mar 2020 22:19:20 +0800 Subject: [PATCH] Call TESTANDREPLACEFILE instead of mv To avoid the timestamp change even the content is same --- examples/elf/tests/Makefile | 2 +- examples/module/drivers/Makefile | 25 ++++++------------------ examples/posix_spawn/filesystem/Makefile | 2 +- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index 4c062e286..1f0c98788 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -140,7 +140,7 @@ $(DIRLIST_HDR) : populate $(SYMTAB_SRC): populate $(Q) $(TESTS_DIR)/mksymtab.sh $(FSIMG_DIR) >$@.tmp - $(Q) mv $@.tmp $@ + $(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@) # Clean each subdirectory diff --git a/examples/module/drivers/Makefile b/examples/module/drivers/Makefile index 9d054b751..7d255ce1f 100644 --- a/examples/module/drivers/Makefile +++ b/examples/module/drivers/Makefile @@ -94,16 +94,12 @@ ifeq ($(CONFIG_EXAMPLES_MODULE_ROMFS),y) # Create the romfs.img file from the populated fsroot directory $(ROMFS_IMG): populate -ifeq ($(CONFIG_EXAMPLES_MODULE_BUILTINFS),y) $(Q) genromfs -f $@ -d $(FSROOT_DIR) -V "MODULETEST" -endif # Create the romfs.h header file from the romfs.img file $(FSIMG_HDR) : $(ROMFS_IMG) -ifeq ($(CONFIG_EXAMPLES_MODULE_BUILTINFS),y) $(Q) (cd $(DRIVER_DIR); xxd -i romfs.img | sed -e "s/^unsigned/static const unsigned/g" >$@) -endif else ifeq ($(CONFIG_EXAMPLES_MODULE_CROMFS),y) # Make sure that the NuttX gencromfs tool has been built @@ -117,23 +113,14 @@ $(FSIMG_HDR) : populate $(NXTOOLDIR)/$(GENCROMFSEXE) $(Q) $(NXTOOLDIR)/$(GENCROMFSEXE) $(FSIMG_DIR) $(FSIMG_HDR) endif - -# Create the exported symbol table - -$(SYMTAB_SRC): populate - $(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@.tmp - $(Q) mv $@.tmp $@ - -else - -# Create the exported symbol table - -$(SYMTAB_SRC): populate - $(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@.tmp - $(Q) mv $@.tmp $@ - endif +# Create the exported symbol table + +$(SYMTAB_SRC): populate + $(Q) $(DRIVER_DIR)/mksymtab.sh $(FSROOT_DIR) >$@.tmp + $(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@) + # Copy the symbol table into the kernel pass1/ build directory $(PASS1_SYMTAB): $(SYMTAB_SRC) diff --git a/examples/posix_spawn/filesystem/Makefile b/examples/posix_spawn/filesystem/Makefile index 34c3e21ac..46e3c9b36 100644 --- a/examples/posix_spawn/filesystem/Makefile +++ b/examples/posix_spawn/filesystem/Makefile @@ -79,7 +79,7 @@ $(ROMFS_HDR) : $(ROMFS_IMG) $(SYMTAB_SRC): $(ROMFS_IMG) $(Q) $(FILESYSTEM_DIR)$(DELIM)mksymtab.sh $(ROMFS_DIR) >$@.tmp - $(Q) mv $@.tmp $@ + $(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@) # Clean each subdirectory