MOC ?= moc
MOCPATH ?= $(QTDIR)/bin/$(MOC)
#LINK=g++
+# included for documentation purposes if not using the relevant hints files;
+# when not using those to manage the value, it should remain empty
+#QTn_H =
# The default is for the TARGET_* variables to match the defaults.
# If we're cross-compiling these will get overridden elsewhere, likely via
$(TARGETPFX)winmisc.o $(TARGETPFX)winstat.o $(TARGETPFX)wintext.o \
$(TARGETPFX)winval.o $(TARGETPFX)tile.o
#
-# Files for a Qt 3 port (renamed since nethack 3.6.x)
+# Files for a Qt 3 interface (renamed since nethack 3.6.x)
#
#WINQT3SRC = ../win/Qt3/qt3_win.cpp ../win/Qt3/qt3_clust.cpp \
# ../win/Qt3/qt3tableview.cpp
WINQT3OBJ =
#
-# Files for a Qt 4 or 5 port
+# Files for a Qt 4, Qt 5, or Qt 6 interface
#
+# generated source files made by Qt's 'moc' program from ../win/Qt/qt_*.h;
+# appended to WINQTSRC for use by 'make depend'
+WINQTMOC = qt_kde0.moc qt_main.moc qt_map.moc qt_menu.moc qt_msg.moc \
+ qt_plsel.moc qt_set.moc qt_stat.moc qt_xcmd.moc qt_yndlg.moc
WINQTSRC = ../win/Qt/qt_bind.cpp ../win/Qt/qt_click.cpp \
../win/Qt/qt_clust.cpp ../win/Qt/qt_delay.cpp \
../win/Qt/qt_glyph.cpp ../win/Qt/qt_icon.cpp ../win/Qt/qt_inv.cpp \
../win/Qt/qt_plsel.cpp ../win/Qt/qt_rip.cpp ../win/Qt/qt_set.cpp \
../win/Qt/qt_stat.cpp ../win/Qt/qt_str.cpp ../win/Qt/qt_streq.cpp \
../win/Qt/qt_svsel.cpp ../win/Qt/qt_win.cpp ../win/Qt/qt_xcmd.cpp \
- ../win/Qt/qt_yndlg.cpp
+ ../win/Qt/qt_yndlg.cpp $(WINQTMOC)
WINQTOBJ = $(TARGETPFX)qt_bind.o $(TARGETPFX)qt_click.o \
$(TARGETPFX)qt_clust.o $(TARGETPFX)qt_delay.o \
$(TARGETPFX)qt_glyph.o $(TARGETPFX)qt_icon.o \
Sysatt: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Loading $(GAME)."
- $(AT)$(LD) $(TARGET_LFLAGS) /lib/crt0s.o /lib/shlib.ifile -o $(GAMEBIN) \
- $(HOSTOBJ) $(HOBJ) $(DATE_O) $(LUALIB)
+ $(AT)$(LD) $(TARGET_LFLAGS) /lib/crt0s.o /lib/shlib.ifile \
+ -o $(GAMEBIN) $(HOSTOBJ) $(HOBJ) $(DATE_O) $(LUALIB)
@touch Sysatt
Systos: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
qt3tableview.moc: ../win/Qt3/qt3tableview.h
$(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt3/qt3tableview.h
-# for Qt 5 and 6, template rules to build qt_xyz.moc from corresponding
-# ../win/Qt/qt_xyz.h are in sys/unix/hints/compiler.370 and get added
-# to src/Makefile if the appropriate hints file gets used with setup.sh;
-# so, build support for the Qt interface requires the use of hints...
-
# build monst.o and objects.o before executing '$(MAKE) makedefs'
$(MAKEDEFS): $(FIRSTOBJ) \
../util/makedefs.c ../src/mdlib.c $(CONFIG_H) \
# Source files formerly created by 'makedefs' at build time
# but no longer used.
-# Each is given an artificial dependency upon the one before
-# so that parallel makes will have to build them sequentially.
-# (More for documentation than effect; 'make' should know not
-# to try to build $(MAKEDEFS) for bar.h while it is in the
-# process of building it for foo.h.)
../include/onames.h: $(MAKEDEFS)
@( cd ../util ; $(MAKE) ../include/onames.h )
../include/pm.h: $(MAKEDEFS)
@( cd ../util ; $(MAKE) tags )
clean:
- -rm -f *.o $(HACK_H) $(CONFIG_H)
+ -rm -f *.o $(HACK_H) $(CONFIG_H) moc.qt*
-rm -f monstr.c vis_tab.c ../include/vis_tab.h #obsolete generated files
$(CLEANMORE)
-rm -f ../include/nhlua.h
-rm -f ../include/date.h #created but no longer used, at least by core
-rm -f ../include/onames.h ../include/pm.h #obsolete generated files
- -rm -f tile.c *.moc moc.qt*
+ -rm -f tile.c *.moc Qt*.h-t
-rm -f ../win/gnome/gn_rip.h
package:
../include/monsters.h ../include/mondata.h \
../include/wintype.h ../include/context.h ../include/rm.h \
../include/botl.h ../include/rect.h ../include/region.h \
+ ../include/display.h ../include/vision.h ../include/color.h \
../include/decl.h ../include/quest.h ../include/spell.h \
- ../include/color.h ../include/obj.h ../include/engrave.h \
- ../include/you.h ../include/attrib.h ../include/monst.h \
- ../include/mextra.h ../include/skills.h ../include/timeout.h \
- ../include/trap.h ../include/flag.h ../include/vision.h \
- ../include/display.h ../include/winprocs.h ../include/sys.h
+ ../include/obj.h ../include/engrave.h ../include/you.h \
+ ../include/attrib.h ../include/monst.h ../include/mextra.h \
+ ../include/skills.h ../include/timeout.h ../include/trap.h \
+ ../include/flag.h ../include/winprocs.h ../include/sys.h
touch $(HACK_H)
#
$(TARGETPFX)pcmain.o: ../sys/share/pcmain.c $(HACK_H) ../include/dlb.h
../win/Qt/qt_rip.h ../win/Qt/qt_msg.h ../win/Qt/qt_plsel.h \
../win/Qt/qt_svsel.h ../win/Qt/qt_set.h ../win/Qt/qt_stat.h \
../win/Qt/qt_icon.h ../win/Qt/qt_streq.h ../win/Qt/qt_line.h \
- ../win/Qt/qt_yndlg.h ../win/Qt/qt_str.h ../include/dlb.h
+ ../win/Qt/qt_yndlg.h ../win/Qt/qt_str.h ../include/dlb.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_bind.cpp
$(TARGETPFX)qt_click.o: ../win/Qt/qt_click.cpp $(HACK_H) ../win/Qt/qt_pre.h \
- ../win/Qt/qt_post.h ../win/Qt/qt_click.h
+ ../win/Qt/qt_post.h ../win/Qt/qt_click.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_click.cpp
-$(TARGETPFX)qt_clust.o: ../win/Qt/qt_clust.cpp ../win/Qt/qt_clust.h
+$(TARGETPFX)qt_clust.o: ../win/Qt/qt_clust.cpp ../win/Qt/qt_clust.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_clust.cpp
$(TARGETPFX)qt_delay.o: ../win/Qt/qt_delay.cpp $(HACK_H) ../win/Qt/qt_pre.h \
- ../win/Qt/qt_post.h ../win/Qt/qt_delay.h
+ ../win/Qt/qt_post.h ../win/Qt/qt_delay.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_delay.cpp
-$(TARGETPFX)qt_glyph.o: ../win/Qt/qt_glyph.cpp $(HACK_H) ../include/tile2x11.h \
- ../win/Qt/qt_pre.h ../win/Qt/qt_post.h ../win/Qt/qt_glyph.h \
- ../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
- ../win/Qt/qt_set.h ../win/Qt/qt_inv.h ../win/Qt/qt_map.h \
- ../win/Qt/qt_win.h ../win/Qt/qt_clust.h ../win/Qt/qt_str.h
+$(TARGETPFX)qt_glyph.o: ../win/Qt/qt_glyph.cpp $(HACK_H) \
+ ../include/tile2x11.h ../win/Qt/qt_pre.h ../win/Qt/qt_post.h \
+ ../win/Qt/qt_glyph.h ../win/Qt/qt_bind.h ../win/Qt/qt_main.h \
+ ../win/Qt/qt_kde0.h ../win/Qt/qt_set.h ../win/Qt/qt_inv.h \
+ ../win/Qt/qt_map.h ../win/Qt/qt_win.h ../win/Qt/qt_clust.h \
+ ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_glyph.cpp
$(TARGETPFX)qt_icon.o: ../win/Qt/qt_icon.cpp $(HACK_H) ../win/Qt/qt_pre.h \
- ../win/Qt/qt_post.h ../win/Qt/qt_icon.h
+ ../win/Qt/qt_post.h ../win/Qt/qt_icon.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_icon.cpp
$(TARGETPFX)qt_inv.o: ../win/Qt/qt_inv.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_inv.h ../win/Qt/qt_glyph.h \
../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_set.h \
- ../win/Qt/qt_bind.h
+ ../win/Qt/qt_bind.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_inv.cpp
$(TARGETPFX)qt_key.o: ../win/Qt/qt_key.cpp $(HACK_H) ../win/Qt/qt_pre.h \
- ../win/Qt/qt_post.h ../win/Qt/qt_key.h
+ ../win/Qt/qt_post.h ../win/Qt/qt_key.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_key.cpp
$(TARGETPFX)qt_line.o: ../win/Qt/qt_line.cpp $(HACK_H) ../win/Qt/qt_pre.h \
- ../win/Qt/qt_post.h ../win/Qt/qt_line.h
+ ../win/Qt/qt_post.h ../win/Qt/qt_line.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_line.cpp
$(TARGETPFX)qt_main.o: ../win/Qt/qt_main.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
../win/Qt/qt_inv.h ../win/Qt/qt_key.h ../win/Qt/qt_map.h \
../win/Qt/qt_win.h ../win/Qt/qt_clust.h ../win/Qt/qt_msg.h \
../win/Qt/qt_set.h ../win/Qt/qt_stat.h ../win/Qt/qt_icon.h \
- ../win/Qt/qt_str.h qt_kde0.moc
+ ../win/Qt/qt_str.h qt_kde0.moc $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_main.cpp
$(TARGETPFX)qt_map.o: ../win/Qt/qt_map.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_map.h ../win/Qt/qt_win.h \
../win/Qt/qt_clust.h qt_map.moc ../win/Qt/qt_click.h \
../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_bind.h \
- ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_map.cpp
$(TARGETPFX)qt_menu.o: ../win/Qt/qt_menu.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_menu.h ../win/Qt/qt_win.h \
../win/Qt/qt_rip.h qt_menu.moc ../win/Qt/qt_key.h \
../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_bind.h \
../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_streq.h \
- ../win/Qt/qt_line.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_line.h ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_menu.cpp
$(TARGETPFX)qt_msg.o: ../win/Qt/qt_msg.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_msg.h ../win/Qt/qt_win.h \
qt_msg.moc ../win/Qt/qt_map.h ../win/Qt/qt_clust.h \
../win/Qt/qt_set.h ../win/Qt/qt_bind.h ../win/Qt/qt_main.h \
- ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_msg.cpp
$(TARGETPFX)qt_plsel.o: ../win/Qt/qt_plsel.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_plsel.h qt_plsel.moc \
../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
- ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_glyph.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_plsel.cpp
$(TARGETPFX)qt_rip.o: ../win/Qt/qt_rip.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_rip.h ../win/Qt/qt_bind.h \
- ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_rip.cpp
$(TARGETPFX)qt_set.o: ../win/Qt/qt_set.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_set.h ../win/Qt/qt_bind.h \
../win/Qt/qt_main.h ../win/Qt/qt_kde0.h qt_set.moc \
- ../win/Qt/qt_glyph.h ../win/Qt/qt_xcmd.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_glyph.h ../win/Qt/qt_xcmd.h ../win/Qt/qt_str.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_set.cpp
$(TARGETPFX)qt_stat.o: ../win/Qt/qt_stat.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_stat.h ../win/Qt/qt_win.h \
../win/Qt/qt_icon.h qt_stat.moc ../win/Qt/qt_set.h \
../win/Qt/qt_bind.h ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h \
- ../win/Qt/qt_str.h ../win/Qt/qt_xpms.h
+ ../win/Qt/qt_str.h ../win/Qt/qt_xpms.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_stat.cpp
-$(TARGETPFX)qt_str.o: ../win/Qt/qt_str.cpp ../win/Qt/qt_str.h
+$(TARGETPFX)qt_str.o: ../win/Qt/qt_str.cpp ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_str.cpp
$(TARGETPFX)qt_streq.o: ../win/Qt/qt_streq.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_streq.h ../win/Qt/qt_line.h \
../win/Qt/qt_str.h ../win/Qt/qt_set.h ../win/Qt/qt_bind.h \
- ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h
+ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_streq.cpp
$(TARGETPFX)qt_svsel.o: ../win/Qt/qt_svsel.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_svsel.h ../win/Qt/qt_bind.h \
- ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_str.h \
+ $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_svsel.cpp
$(TARGETPFX)qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_win.h ../win/Qt/qt_bind.h \
../win/Qt/qt_glyph.h ../win/Qt/qt_inv.h ../win/Qt/qt_key.h \
../win/Qt/qt_icon.h ../win/Qt/qt_map.h ../win/Qt/qt_clust.h \
../win/Qt/qt_menu.h ../win/Qt/qt_rip.h ../win/Qt/qt_msg.h \
- ../win/Qt/qt_set.h
+ ../win/Qt/qt_set.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_win.cpp
$(TARGETPFX)qt_xcmd.o: ../win/Qt/qt_xcmd.cpp $(HACK_H) ../include/func_tab.h \
../win/Qt/qt_pre.h ../win/Qt/qt_post.h ../win/Qt/qt_xcmd.h \
qt_xcmd.moc ../win/Qt/qt_key.h ../win/Qt/qt_bind.h \
../win/Qt/qt_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_set.h \
- ../win/Qt/qt_str.h
+ ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_xcmd.cpp
$(TARGETPFX)qt_yndlg.o: ../win/Qt/qt_yndlg.cpp $(HACK_H) ../win/Qt/qt_pre.h \
../win/Qt/qt_post.h ../win/Qt/qt_yndlg.h qt_yndlg.moc \
- ../win/Qt/qt_key.h ../win/Qt/qt_str.h
+ ../win/Qt/qt_key.h ../win/Qt/qt_str.h $(QTn_H)
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_yndlg.cpp
+qt_kde0.moc: ../win/Qt/qt_kde0.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_kde0.h
+qt_main.moc: ../win/Qt/qt_main.h ../win/Qt/qt_kde0.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_main.h
+qt_map.moc: ../win/Qt/qt_map.h ../win/Qt/qt_win.h ../win/Qt/qt_clust.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_map.h
+qt_menu.moc: ../win/Qt/qt_menu.h ../win/Qt/qt_win.h ../win/Qt/qt_rip.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_menu.h
+qt_msg.moc: ../win/Qt/qt_msg.h ../win/Qt/qt_win.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_msg.h
+qt_plsel.moc: ../win/Qt/qt_plsel.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_plsel.h
+qt_set.moc: ../win/Qt/qt_set.h ../win/Qt/qt_bind.h ../win/Qt/qt_main.h \
+ ../win/Qt/qt_kde0.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_set.h
+qt_stat.moc: ../win/Qt/qt_stat.h ../win/Qt/qt_win.h ../win/Qt/qt_icon.h \
+ $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_stat.h
+qt_xcmd.moc: ../win/Qt/qt_xcmd.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_xcmd.h
+qt_yndlg.moc: ../win/Qt/qt_yndlg.h $(QTn_H)
+ $(MOCPATH) -o $@ ../win/Qt/qt_yndlg.h
$(TARGETPFX)wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H)
$(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/chain/wc_chainin.c
$(TARGETPFX)wc_chainout.o: ../win/chain/wc_chainout.c $(HACK_H)
# during development;
# patchlev.h gets special handling because it only exists on systems
# which consider filename patchlevel.h to be too long;
+# amiconf.h moved from ../include/ to ../outdated/include/ so skip it
# interp.c gets special handling because it usually doesn't exist; it's
# assumed to be the last #include in the file where it occurs.
# win32api.h gets special handling because it only exists for some ports;
special[++sp_cnt] = "../include/hack.h"
alt_deps["../include/extern.h"] = ""
alt_deps["../include/patchlev.h"] = ""
+ alt_deps["../include/amiconf.h"] = ""
alt_deps["interp.c"] = " #interp.c" #comment it out
alt_deps["../include/win32api.h"] = " #../include/win32api.h"
alt_deps["../include/zlib.h"] = " #zlib.h" #comment it out
FNR == 1 { output_dep() #finish previous file
file = FILENAME #setup for current file
}
-/^\#[ \t]*include[ \t]+\"/ { #find `#include "X"'
+/^[#][ \t]*include[ \t]+["]/ { #find `#include "X"'
incl = $2
#[3.4.0: gnomehack headers currently aren't in include]
#[3.6.2: Qt4 headers aren't in include either]
#[3.6.2: curses headers likewise]
- #[3.7.0: Qt headers have moved]
- if (incl ~ /\.h$/) {
- if (incl ~ "curses\.h")
+ #[3.7.0: Qt headers have moved; process 'moc' files]
+ if (incl ~ /[.]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
else if (incl ~ /^curs/) # curses special case
incl = "../win/curses/" incl
- 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
+ else if (incl ~ /(.*\/)*qt_/) { # Qt special cases
# 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
+ # Qt v4/v5/v6 headers are in ../win/Qt
+ # *.moc files have path in their #include
+ if (file ~ /[.]moc$/)
+ ; # keep 'incl' as-is
+ else if (file ~ /^[.][.]\/win\/Qt3\/.*/)
+ incl = "../win/Qt3/" incl
+ else # Qt v4/v5/v6
+ incl = "../win/Qt/" incl
} else if (incl ~ /^gn/) # gnomehack special case
incl = "../win/gnome/" incl
else
# don't do anything (we've just been collecting their dependencies);
# for .c files, output the `make' rule for corresponding .o file
#
-function output_dep( targ)
+function output_dep( base, targ, moc)
{
- if (file ~ /\.cp*$/) {
+ #get the file's base name (including suffix)
+ base = file; sub("^.+/", "", base)
+ #for qt source files, add qt timestamp file as extra dependency
+ moc = (base ~ /[.]moc$/)
+ if (moc || base ~ /(.+\/)*qt_.*[.]cpp$/) {
+ deps[file] = deps[file] " $(QTn_H)"
+ }
+ if (base ~ /[.]cp*$/ || moc) {
#prior to very first .c|.cpp file, handle some special header file cases
if (!c_count++)
output_specials()
#construct object filename from source filename
- targ = file; sub("^.+/", "", targ); sub("\\.cp*$", ".o", targ)
+ targ = base; sub("[.]cp*$", ".o", targ)
#format and write the collected dependencies
format_dep(targ, file)
}
#change "../include/foo.h" first to "foo.h", then ultimately to "$(FOO_H)"
alt_sp = sp; sub("^.+/", "", alt_sp)
print "#", alt_sp, "timestamp" #output a `make' comment
- #- sub("\\.", "_", alt_sp); alt_sp = "$(" toupper(alt_sp) ")"
+ #- sub("[.]", "_", alt_sp); alt_sp = "$(" toupper(alt_sp) ")"
#+ Some nawks don't have toupper(), so hardwire these instead.
sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp)
format_dep(alt_sp, sp) #output the target
# 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, col, n, i, list)
+function format_dep(target, source, col, n, i, list, prefix, moc)
{
- if (substr(target,1,1) == "$") {
- prefix = ""
- } else {
- prefix = "$(TARGETPFX)"
- }
split("", done) #``for (x in done) delete done[x]''
+ moc = (target ~ /[.]moc$/)
+ prefix = (moc || substr(target,1,1) == "$") ? "" : "$(TARGETPFX)"
printf("%s%s:", prefix, target); col = length(target) + 1 + length(prefix)
#- printf("\t"); col += 8 - (col % 8);
#- if (col == 8) { printf("\t"); col += 8 }
source = depend("", source, 0)
n = split(source, list, " +")
- for (i = 2; i <= n; i++) { #(leading whitespace yields empty 1st element)
- if (col + length(list[i]) >= (i < n ? 78 : 80)) {
+ #first: leading whitespace yields empty 1st element; not sure why moc
+ #files duplicate the target as next element but we need to skip that too
+ first = moc ? 3 : 2
+ for (i = first; i <= n; i++) {
+ if (col + length(list[i]) >= (i < n ? 78 : 80) - 1) {
printf(" \\\n\t\t"); col = 16 #make a backslash+newline split
} else {
printf(" "); col++;
}
printf("\n") #terminate
#write build command if first source entry has non-include path prefix
- source = list[2]
- if (source ~ /\// && substr(source, 1, 11) != "../include/") {
- if (source ~ /\.cpp$/ )
+ source = list[first]
+ if (moc) {
+ print "\t$(MOCPATH) -o $@ " source
+ } else if (source ~ /\// && substr(source, 1, 11) != "../include/") {
+ if (source ~ /[.]cpp$/ )
print "\t$(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ " source
else if (source ~ /\/X11\//) # "../win/X11/foo.c"
print "\t$(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ " source