Commit Graph

24 Commits

Author SHA1 Message Date
nhkeni
9dbab97a1e depend.awk: Allow sort suppression from the command line. Idea from Pat. 2024-03-17 12:17:41 -04:00
nhkeni
ab6d7cdc3b depend.awk: bugfix for commented out replacement text 2024-03-13 22:04:19 -04:00
nhkeni
0edfb577f7 Two more bug fixes:
split depend target so "make depend" and "make updatedepend"
 get the right dependencies (this puts back the previously
 temporarily removed dependencies)

deterministically pull out the right source so moc rules
 are correct
2024-03-10 19:51:55 -04:00
nhkeni
ae82f6494e bug fixes 2024-03-10 15:46:20 -04:00
nhkeni
7ad921ebe7 Merge branch 'keni-pending2' into NetHack-3.7 2024-03-10 10:36:24 -04:00
nhkeni
a22ed4f232 depend.awk changes
- sort the dependencies
- sort the rules
- the above can be disabled in the BEGIN block
- usage documentation changes for next commit
2024-03-09 15:23:15 -05:00
nhkeni
bea2d208dd depend.awk: sort the dependencies
Can be disabled in the BEGIN block (set dosort = 0).

Blame this change on the Department of Motor Vehicles :-)
2024-03-04 13:38:17 -05:00
PatR
1d0e4729bd 'make depend' again
Having source files with the same name in different subdirectories
won't work because their object files would conflict, but don't allow
the failure to be because depend.awk left out the conflicting rules.

No change in behavior from the most recent commit.
2023-10-14 14:36:42 -07:00
PatR
db48b92dd3 avoid redundant unix dependency for tile.o 2023-10-14 13:48:47 -07:00
PatR
6cf077a684 depend.awk update
cppregex.cpp recently had `#include "extern.h"' added as the last
quoted include.  That gets set to "" while collecting dependencies,
then preceded by a space when output.  So the unexpected trailing
space was new and wasn't caused by a change of awk versions as I
was suspecting.  This removes it.
2023-02-04 12:58:06 -08:00
PatR
f9f209bb49 Qt 5 vs Qt 6 revisited plus 'make depend' update
Rename the recently added timestamp file used to throw away old qt
'moc' files from moc.qt5 or moc.qt6 to Qt5.h-t or Qt6.h-t and use
that to also throw away old qt_*.o when switching from Qt 5 to Qt 6
or vice versa.  Temporarily the old names remain in Makefile.src's
'clean' target and in src/.gitignore but those will be removed soon.

Update 'make depend' to add the timestamp file to qt_*.o dependencies.
Have it generate rules to build qt_*.moc from ../win/Qt/qt_*.h instead
of using a template rule in hints/include/compiler.370.  So building
the Qt interface doesn't require use of that hints file anymore and
someone reading Makefile.src won't have to know about it, but using
those hints will make their life easier.

Simplify the Qt timestamp handling portion of compiler.370.  Only one
extra rule gets added when creating src/Makefile.

src/Makefile generated from sys/unix/Makefile.src that's been rebuilt
with 'make depend' got broken by uncommenting '#include "amiconf.h"'
in global.h.  That file isn't in include/ but every object file now
depended on it and make didn't know what to do about that.  Have
depend.awk treat it as a special case so that no object files depend
on it.  That means that actually modifying it won't trigger a rebuild;
anyone fiddling with that will have to always do 'make clean' or
'touch config.h-t' after changing it.  The alternative is to move it
from outdated/include/ back to include/.

In depend.awk, recent gawk complained that "\." wasn't a defined
escape sequence in regular expressions so it would be treated as ".".
That's exactly what is intended but change it to "[.]" to avoid the
warning.  Similarly for one instance each of "\#" and '\"'.  I also
tried changing "\/" to "[/]" even though that is a defined sequence
and doesn't trigger any warning.  gawk accepted it but the awk that
comes with OSX choked on it so I changed it back to "\/".
2022-02-05 04:15:51 -08:00
PatR
0b1f5ea45e outdated vs Unix 'make depend'
After the most recent round of moving old stuff to 'outdated',
src/windows.c contained two references to non-existent files.
That broke 'make depend'.  Updating it to turn those two into
comments seems risky because someone might add an include for
some new interface later in the file.  So comment them out in
the source instead.  Also, redo previous 'make depend' update
from about three weeks ago to do the same thing.
2021-01-31 13:05:32 -08:00
PatR
129ff12245 'make depend' fix
The gone but still referenced state of amiconf.h broke 'make depend'.
Fixing that turns it into a comment in the generated dependencies
but that ran into a problem with it being followed by fnamesiz.h
instead of being last in the list containing it.  So in addition to
the depend fix, move #include "fnamesiz.h" from config.h to global.h
in order to have it come before amiconf.h.
2021-01-08 13:33:27 -08:00
nhmall
b9b4755fe3 expand sys/unix Makefiles scope
Expand the use of the sys/unix Makefiles to be used for both normal
local builds and installs, as well as cross-compiles for other
platforms/targets.

Up until now, the primary unix Makefiles have treated util/host-side
component compiles, links and target object files just the same as
the game component compiles, links, and target object files.

Unfortunately, that meant that cross-compile effort typically had
to re-invent Makefiles specific to the cross-compile, creating a
maintenance burden and deviation from the typical local unix build
and providing a daunting obstacle to those that want to establish
build for a target environment/platform.

This change distinguishes between util/host-side component builds,
links, and component builds and targets object files destined for
the game (and other target platforms) in the Makefiles.

In theory, this will ease the effort for people that want to try to
resurrect NetHack perhaps on an old platform where it is no longer
viable to build NetHack-3.7 on the platform itself using old, outdated
compile tools, possibly with an old, outdated C dialect.

Some details:

-  Game-related targets in the Makefiles (as opposed to util/host-side
   targets that will be executed on the host), which could be destined
   for another platform in a cross-compile scenario are prefixed with
   $(TARGETPFX) so that they are distinguished.

   The default scenario where no cross-compiler is involved, is to
   define TARGETPFX to nothing, and therefore meant to have no effect.

-  Game-related compile and link commands in the Makefiles and their
   associated command line flags are distinguished from util/host-side
   compile and link commands in the Makefiles by using $(TARGET_CC),
   $(TARGET_CFLAGS), $(TARGET_LINK), $(TARGET_LFLAGS), $(TARGET_CXX),
   $(TARGET_CXXFLAGS), $(TARGET_LIBS).

   Those are used in the Makefile in place of $(CC), $(CFLAGS), $(LINK),
   $(LFLAGS), $(CXX), $(CXXFLAGS), $(LIBS).

   The default scenario where no cross-compiler is involved, defines
   the TARGET_ version of those Makefile variables to match their
   typical non-TARGET_ ounterparts.

-  The dependency lists in the Makefiles includes the $(TARGETPFX)
   prefix for stuff that would potentially be produced from a
   cross-compile build.

-  It adds pregame targets and $(PREGAME) variable, so that hints files
   can add some additional stuff if required for a cross-compile
   scenario.

   The default scenario where no cross-compiler is involved doesn't
   do anything for $(PREGAME).

-  It adds $(BUILDMORE) target and variable, so that hints files
   can add some additional things to be built for a cross-compile
   scenario.

-  It adds a "package" target and $(PACKAGE) variable, so that hints files
   can add steps for the target platform in a cross-compile
   scenario.

   The "install" target assumes local build and placement and
   isn't really applicable to a cross-compile scenario where the results
   really just need to be bundled up for transport to the target platform.

-  Also, this adds a pair of include files that can be updated with some
   cross-compile recipes as they evolve. They are named "cross-pre.2020"
   (for stuff to be included in the PRE section) and "cross-post.2020"
   for stuff to be included in the POST section via sys/unix/setup.sh.

   Those are included in sys/unix/hints/linux.2020 and
   sys/unix/hints/macOS.2020 hints files.
2020-09-28 16:25:31 -04:00
PatR
2fe31eec46 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.
2019-12-09 11:15:49 -08:00
Patric Mueller
b9f3a33ec9 Update depend.awk for the new Qt location and lua headers 2019-12-08 14:41:54 +01:00
PatR
3cc4db7950 Unix Makefile
Separate the compiler flags used for compiling X11 code from the rest
of CFLAGS.  Affects hints/macosx10.8 and later.

Add an explicit output argument to the generated compile rules.
2018-12-30 17:39:56 -08:00
PatR
a8fe565912 'make depend' update for unix/Makefile.src
The dependency for pcmain.o is different from depend.awk generates
so re-running 'make depend' after this will think another change is
needed.
2018-11-28 15:23:02 -08:00
keni
09502df9f1 force expand unexpanded substitution variables 2018-04-25 15:36:11 -04:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
keni
7d9ea49e92 Another batch of manual header var additions 2015-02-26 17:43:47 -05:00
nethack.rankin
0303517e2d depend.awk (trunk only)
I don't have any way to test this, but zlib.h needs special handling
to prevent compilation problems for anyone who doesn't have it.
2005-12-15 03:42:52 +00:00
nethack.allison
742e1e8c90 3.3.2 to 3.4.0 2002-02-04 16:11:00 +00:00
jwalz
5a3b84c57c *** empty log message *** 2002-01-05 21:05:59 +00:00