refs #496 An extra makefile target which touches a file so make can know that copied files are up-to-date.

This commit is contained in:
Mathew Sutcliffe
2015-10-15 21:43:43 +01:00
parent 9e9dd95dca
commit a9a6fbc4c0

View File

@@ -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}
}