From a9a6fbc4c0513a532ef1e6fdd6cdefdc019acb98 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Thu, 15 Oct 2015 21:43:43 +0100 Subject: [PATCH] refs #496 An extra makefile target which touches a file so make can know that copied files are up-to-date. --- mkspecs/features/copyfiles.pri | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/copyfiles.pri b/mkspecs/features/copyfiles.pri index 44bd77eac..67fa813b0 100644 --- a/mkspecs/features/copyfiles.pri +++ b/mkspecs/features/copyfiles.pri @@ -9,10 +9,12 @@ defineReplace(fileCopyDestination) { win32:isEmpty(MINGW_IN_SHELL) { copy_files.commands = copy /y ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + TOUCH = copy /y nul } else { copy_files.commands = mkdir -p `dirname ${QMAKE_FILE_OUT}` && \ cp ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + TOUCH = touch } QMAKE_EXTRA_COMPILERS += copy_files @@ -21,6 +23,14 @@ QMAKE_EXTRA_COMPILERS += copy_files # This CONFIG should be all that is needed to add a dependency to "make all" # but some snafu with absolute vs. relative paths necessitates this workaround # with PRE_TARGETDEPS instead. - #copy_files.CONFIG += target_predeps -PRE_TARGETDEPS += compiler_copy_files_make_all + +copy_files_cookie.depends = compiler_copy_files_make_all +copy_files_cookie.target = copy_files.cookie +win32:!mingw: copy_files_cookie.commands = $$TOUCH $** && $$TOUCH $@ +else: copy_files_cookie.commands = $$TOUCH $< && $$TOUCH $@ +QMAKE_EXTRA_TARGETS += copy_files_cookie + +!isEmpty($${copy_files.input}) { + PRE_TARGETDEPS += $${copy_files_cookie.target} +}