more Qt rename

In order for 'make depend' to be able to handle both Qt4/5 and Qt3,
they need to operate on different object file names.

renames qt*.o to qt3*.o for Qt3
renames qt*.cpp to qt3*.cpp for Qt3 (not essential but seems worthwhile)
moves Qt3's headers from include/qt*.h to win/Qt3/qt3*.h
copies include/qt_xpms.h (before rename) or win/Qt3/qt3_xpms.h (after)
    to win/Qt/qt_xpms.h so that Qt4/5 no longer shares one header file
modifies win/Qt3/*.cpp and win/Qt3/qt3_win.h to reflect new header names
modifies Makefile.src to have Qt3 'moc' commands use new names
updates Makefile.src via re-running 'make depend'

'make depend' was only looking at include/*.h to find nested inclusion.
Now it will also look at win/*/*.h.  That found a bunch of missing
dependencies for the old gnome sources and a few for Qt3.

Building without Qt still works.  Building with it (any version) has
not been tested.
This commit is contained in:
PatR
2019-12-09 11:15:49 -08:00
parent cb2e02ef75
commit 2fe31eec46
11 changed files with 1576 additions and 91 deletions

View File

@@ -1,6 +1,6 @@
# depend.awk -- awk script used to construct makefile dependencies
# for nethack's source files (`make depend' support for Makefile.src).
# $NHDT-Date: 1546220373 2018/12/31 01:39:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.8 $
# $NHDT-Date: 1575916941 2019/12/09 18:42:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $
#
# usage:
# cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files
@@ -43,20 +43,23 @@ FNR == 1 { output_dep() #finish previous file
#[3.6.2: curses headers likewise]
#[3.7.0: Qt headers have moved]
if (incl ~ /\.h$/) {
if (incl ~ "curses\.h")
incl = "" # skip "curses.h"; it should be <curses.h>
if (incl ~ "curses\.h")
incl = "" # skip "curses.h"; it should be <curses.h>
else if (incl ~ /^..\/lib\/lua-.*\/src\/l/)
incl = "" # skip lua headers
incl = "" # skip lua headers
else if (incl ~ /^curs/) # curses special case
incl = "../win/curses/" incl
else if (incl ~ /^qtext.h/) # qtext.h special case
incl = "../include/" incl
else if (incl ~ /^qt_xpms.h/) # qt_xpms.h special case
incl = "../include/" incl
else if (incl ~ /^qt/) # Qt v4 special case
incl = "../win/Qt/" incl
else if (incl ~ /^gn/) # gnomehack special case
else if (incl ~ /^qt/) { # Qt special cases
# qtext.h is a core header that accidentally matches...
if (incl ~ /^qtext.h/) # ...the Qt exception
incl = "../include/" incl
# Qt v3 headers are in ../win/Qt3
# Qt v4/v5 headers are in ../win/Qt
else if (FILENAME ~ /^\.\.\/win\/Qt3\/.*/)
incl = "../win/Qt3/" incl
else # Qt v4
incl = "../win/Qt/" incl
} else if (incl ~ /^gn/) # gnomehack special case
incl = "../win/gnome/" incl
else
incl = "../include/" incl
@@ -108,7 +111,7 @@ function output_specials( i, sp, alt_sp)
# write a target and its dependency list in pretty-printed format;
# if target's primary source file has a path prefix, also write build command
#
function format_dep(target, source, n, i, list)
function format_dep(target, source, col, n, i, list)
{
split("", done) #``for (x in done) delete done[x]''
printf("%s:", target); col = length(target) + 1