Commit 4834d8a4 authored by Ben Avison's avatar Ben Avison
Browse files

Preserve gitignore files when cleaning native builds

Change `CModule` shared makefile so that it adapts according to whether its
including makefile's component has a [./]gitignore file in one or more of its
subdirectories. Git will consider the deletion of such files as significant,
and that is usually not the developer's intention.

This requires a fully-functional version of amu's `$(wildcard)` function,
which was only introduced at amu 5.33, so use RiscOS/Env!5 to adapt according
to whether a new enough version is installed.
parent 8707a1eb
......@@ -248,7 +248,32 @@ ${DIRS} ::
#
# Clean the module
#
FILES_TO_CLEAN := $(filter-out /gitignore,$(wildcard aif.* aof.* i.* linked.* gpa.* o.* od.* rm.*))
clean ::
ifeq ("${AMU$HasWorkingWildcard}","-1")
ifneq ("${FILES_TO_CLEAN}","")
@${ECHO} rm ${FILES_TO_CLEAN}
@Unix.rm ${FILES_TO_CLEAN}
endif
@IfThere ${MERGEDRDIR} Then ${ECHO} ${WIPE} ${MERGEDRDIR} ${WFLAGS}
@IfThere ${MERGEDRDIR} Then ${WIPE} ${MERGEDRDIR} ${WFLAGS}
@IfThere aif.* Then Else IfThere aif Then ${ECHO} ${WIPE} aif ${WFLAGS}
@IfThere aif.* Then Else IfThere aif Then ${WIPE} aif ${WFLAGS}
@IfThere aof.* Then Else IfThere aof Then ${ECHO} ${WIPE} aof ${WFLAGS}
@IfThere aof.* Then Else IfThere aof Then ${WIPE} aof ${WFLAGS}
@IfThere i.* Then Else IfThere i Then ${ECHO} ${WIPE} i ${WFLAGS}
@IfThere i.* Then Else IfThere i Then ${WIPE} i ${WFLAGS}
@IfThere linked.* Then Else IfThere linked Then ${ECHO} ${WIPE} linked ${WFLAGS}
@IfThere linked.* Then Else IfThere linked Then ${WIPE} linked ${WFLAGS}
@IfThere gpa.* Then Else IfThere gpa Then ${ECHO} ${WIPE} gpa ${WFLAGS}
@IfThere gpa.* Then Else IfThere gpa Then ${WIPE} gpa ${WFLAGS}
@IfThere o.* Then Else IfThere o Then ${ECHO} ${WIPE} o ${WFLAGS}
@IfThere o.* Then Else IfThere o Then ${WIPE} o ${WFLAGS}
@IfThere od.* Then Else IfThere od Then ${ECHO} ${WIPE} od ${WFLAGS}
@IfThere od.* Then Else IfThere od Then ${WIPE} od ${WFLAGS}
@IfThere rm.* Then Else IfThere rm Then ${ECHO} ${WIPE} rm ${WFLAGS}
@IfThere rm.* Then Else IfThere rm Then ${WIPE} rm ${WFLAGS}
else
@IfThere aif Then ${ECHO} ${WIPE} aif ${WFLAGS}
@IfThere aif Then ${WIPE} aif ${WFLAGS}
@IfThere aof Then ${ECHO} ${WIPE} aof ${WFLAGS}
......@@ -265,6 +290,7 @@ clean ::
@IfThere od Then ${WIPE} od ${WFLAGS}
@IfThere rm Then ${ECHO} ${WIPE} rm ${WFLAGS}
@IfThere rm Then ${WIPE} rm ${WFLAGS}
endif
@IfThere h.${CMHGFILE} Then ${ECHO} ${RM} h.${CMHGFILE}
@IfThere h.${CMHGFILE} Then ${RM} h.${CMHGFILE}
@${ECHO} ${COMPONENT}: cleaned
......
......@@ -4,18 +4,18 @@
*
*/
#define Module_MajorVersion_CMHG 7.40
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Jul 2019
#define Module_MinorVersion_CMHG preserve_gitignore.1
#define Module_Date_CMHG 22 Oct 2019
#define Module_MajorVersion "7.40"
#define Module_Version 740
#define Module_MinorVersion ""
#define Module_Date "20 Jul 2019"
#define Module_MinorVersion "preserve_gitignore.1"
#define Module_Date "22 Oct 2019"
#define Module_ApplicationDate "20-Jul-19"
#define Module_ApplicationDate "22-Oct-19"
#define Module_ComponentName "BuildSys"
#define Module_FullVersion "7.40"
#define Module_HelpVersion "7.40 (20 Jul 2019)"
#define Module_FullVersion "7.40 (preserve_gitignore.1)"
#define Module_HelpVersion "7.40 (22 Oct 2019) preserve_gitignore.1"
#define Module_LibraryVersionInfo "7:40"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment