fix distclean targets

this makes the distclean targets work throughout qt.
the dreaded confclean target is aliased to distclean.

Task-number: QTBUG-8202
Task-number: QTBUG-20566
Change-Id: I7ac8e3b5b0110825dc93e4fa885281db91c6cf83
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-04-23 13:40:49 +02:00
parent 6e2e0e061f
commit 3378aa45c2
6 changed files with 62 additions and 56 deletions

View File

@ -24,6 +24,10 @@ load(qt_build_paths)
-outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
!silent: message($$QMAKE_SYNCQT)
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
include-distclean.commands = $$QMAKE_DEL_TREE $$shell_quote($$shell_path($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME))
QMAKE_EXTRA_TARGETS += include-distclean
DISTCLEAN_DEPS += include-distclean
}
minimal_syncqt: return()
@ -41,11 +45,13 @@ for (injection, SYNCQT.INJECTIONS) {
MAIN_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$fwd_hdr
MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$member(injects, 0)"'
write_file($$MAIN_FWD, MAIN_FWD_CONT)|error("Aborting.")
!git_build: QMAKE_DISTCLEAN += $$MAIN_FWD
injects = $$member(injects, 2, -1)
for (inject, injects) {
CLASS_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$inject
CLASS_FWD_CONT = '$${LITERAL_HASH}include "$$fwd_hdr"'
write_file($$CLASS_FWD, CLASS_FWD_CONT)|error("Aborting.")
!git_build: QMAKE_DISTCLEAN += $$CLASS_FWD
}
}
@ -65,6 +71,7 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD
}
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}endif"
write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.")
!git_build: QMAKE_DISTCLEAN += $$MODULE_MASTER_DEPS_HEADER
}
SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER

View File

@ -71,3 +71,21 @@ exists($$_PRO_FILE_PWD_/tests/tests.pro) {
QT_BUILD_PARTS -= libs tools examples tests
!isEmpty(QT_BUILD_PARTS): warning("Unknown build part(s): $$QT_BUILD_PARTS")
QMAKE_DISTCLEAN += \
.qmake.cache \
config.log \
mkspecs/modules/*.pri \
mkspecs/modules-inst/*.pri
tests = $$files($$_PRO_FILE_PWD_/config.tests/*.pro, true)
testdirs =
for (t, tests): \
testdirs += $$relative_path($$dirname(t), $$_PRO_FILE_PWD_)
testdirs = $$unique(testdirs)
for (td, testdirs) {
t = $$basename(td)-distclean
$${t}.commands = -cd $$shell_path($$td) && $(MAKE) distclean
QMAKE_EXTRA_TARGETS += $$t
DISTCLEAN_DEPS += $$t
}

View File

@ -123,9 +123,11 @@ clean::
distclean:: clean
$(RM_RF) .deps
$(RM_F) $(BUILD_PATH)/bin/qmake$(EXEEXT)
$(RM_F) Makefile
depend:
makedepend -D__MAKEDEPEND__ $(CPPFLAGS) $(DEPEND_SRC)
$(RM_F) Makefile.bak
ioutils.o: $(QMKLIBSRC)/ioutils.cpp

View File

@ -140,7 +140,9 @@ clean::
-del qmake.tds
distclean:: clean
-del qmake
-del qmake.exe
-del $(BUILD_PATH)\bin\qmake.exe
-del Makefile
.c.obj:
$(CXX) $(CFLAGS) $<

View File

@ -8,62 +8,30 @@ SUBDIRS += qmake/qmake-docs.pro
cross_compile: CONFIG += nostrip
confclean.depends += clean
confclean.commands =
unix {
confclean.commands += (cd config.tests/unix/stl && $(MAKE) distclean); \
(cd config.tests/unix/ptrsize && $(MAKE) distclean); \
(cd config.tests/x11/notype && $(MAKE) distclean); \
(cd config.tests/unix/getaddrinfo && $(MAKE) distclean); \
(cd config.tests/unix/cups && $(MAKE) distclean); \
(cd config.tests/unix/psql && $(MAKE) distclean); \
(cd config.tests/unix/mysql && $(MAKE) distclean); \
(cd config.tests/unix/mysql_r && $(MAKE) distclean); \
(cd config.tests/unix/nis && $(MAKE) distclean); \
(cd config.tests/unix/iodbc && $(MAKE) distclean); \
(cd config.tests/unix/odbc && $(MAKE) distclean); \
(cd config.tests/unix/oci && $(MAKE) distclean); \
(cd config.tests/unix/tds && $(MAKE) distclean); \
(cd config.tests/unix/db2 && $(MAKE) distclean); \
(cd config.tests/unix/ibase && $(MAKE) distclean); \
(cd config.tests/unix/ipv6ifname && $(MAKE) distclean); \
(cd config.tests/unix/zlib && $(MAKE) distclean); \
(cd config.tests/unix/sqlite2 && $(MAKE) distclean); \
(cd config.tests/unix/libjpeg && $(MAKE) distclean); \
(cd config.tests/unix/libpng && $(MAKE) distclean); \
(cd config.tests/unix/slog2 && $(MAKE) distclean); \
(cd config.tests/unix/lgmon && $(MAKE) distclean); \
(cd config.tests/x11/xcursor && $(MAKE) distclean); \
(cd config.tests/x11/xrender && $(MAKE) distclean); \
(cd config.tests/x11/xrandr && $(MAKE) distclean); \
(cd config.tests/x11/xkb && $(MAKE) distclean); \
(cd config.tests/x11/xinput && $(MAKE) distclean); \
(cd config.tests/x11/fontconfig && $(MAKE) distclean); \
(cd config.tests/x11/xinerama && $(MAKE) distclean); \
(cd config.tests/x11/xshape && $(MAKE) distclean); \
(cd config.tests/x11/opengl && $(MAKE) distclean); \
$(DEL_FILE) config.tests/.qmake.cache; \
$(DEL_FILE) src/corelib/global/qconfig.h; \
$(DEL_FILE) src/corelib/global/qconfig.cpp; \
$(DEL_FILE) mkspecs/qconfig.pri; \
$(DEL_FILE) mkspecs/qdevice.pri; \
$(DEL_FILE) mkspecs/qmodule.pri; \
$(DEL_FILE) .qmake.cache; \
(cd qmake && $(MAKE) distclean);
}
win32 {
confclean.commands += -$(DEL_FILE) src\\corelib\\global\\qconfig.h $$escape_expand(\\n\\t) \
-$(DEL_FILE) src\\corelib\\global\\qconfig.cpp $$escape_expand(\\n\\t) \
-$(DEL_FILE) mkspecs\\qconfig.pri $$escape_expand(\\n\\t) \
-$(DEL_FILE) mkspecs\\qdevice.pri $$escape_expand(\\n\\t) \
-$(DEL_FILE) mkspecs\\qmodule.pri $$escape_expand(\\n\\t) \
-$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \
(cd qmake && $(MAKE) distclean)
}
confclean.depends += distclean
confclean.commands = echo The confclean target is obsolete. Please use distclean instead.
QMAKE_EXTRA_TARGETS += confclean
qmakeclean.commands += (cd qmake && $(MAKE) clean)
QMAKE_EXTRA_TARGETS += qmakeclean
CLEAN_DEPS += qmakeclean
qmake-clean.commands += (cd qmake && $(MAKE) clean)
QMAKE_EXTRA_TARGETS += qmake-clean
CLEAN_DEPS += qmake-clean
# We don't distclean qmake, as it may be needed for rebuilding Makefiles as a
# recursive distclean proceeds, including beyond qtbase.
DISTCLEAN_DEPS += qmake-clean
# Files created by configure.
# config.status (and configure.cache, which is the same for Windows)
# are omitted for convenience of rebuilds.
QMAKE_DISTCLEAN += \
config.summary \
config.tests/.qmake.cache \
mkspecs/qconfig.pri \
mkspecs/qdevice.pri \
mkspecs/qmodule.pri \
src/corelib/global/qconfig.h \
src/corelib/global/qconfig.cpp \
bin/qt.conf
CONFIG -= qt
@ -186,6 +154,14 @@ FWD_QTCONFIG = \
'$${LITERAL_HASH}include "qconfig.h"'
write_file($$OUT_PWD/include/QtCore/QtConfig, FWD_QTCONFIG)|error("Aborting.")
# Files created by us
QMAKE_DISTCLEAN += \
src/corelib/global/qfeatures.h \
include/QtCore/qfeatures.h \
mkspecs/qfeatures.pri \
include/QtCore/qconfig.h \
include/QtCore/QtConfig
#mkspecs
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
mkspecs.files = \

View File

@ -10,6 +10,7 @@ runtime_resource.depends = $$PWD/testqrc/test.qrc
runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target}
QMAKE_EXTRA_TARGETS = runtime_resource
PRE_TARGETDEPS += $${runtime_resource.target}
QMAKE_DISTCLEAN += $${runtime_resource.target}
TESTDATA += \
parentdir.txt \