From 42d5d6a453b82dba3a9663b32b26f4bf427da955 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 4 Mar 2024 16:13:03 -0800 Subject: [PATCH 1/3] reformat lots of the CRASHREPORT code Replace tabs, split 'if (condtion) do_something' across two lines, insert lots of spaces in things like 'if(condition){'. I changed a lot of C++ style comments to traditional C style, but left quite a few of those as-is. This also rewrites the code that pull request #1216 purports to fix. I still can't make sense of the original and the patched edition. Supersedes #1216 Closes #1216 --- src/end.c | 290 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 159 insertions(+), 131 deletions(-) diff --git a/src/end.c b/src/end.c index 3f1560bdc..78b34f43a 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 end.c $NHDT-Date: 1702023265 2023/12/08 08:14:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.285 $ */ +/* NetHack 3.7 end.c $NHDT-Date: 1709597568 2024/03/05 00:12:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.305 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -200,21 +200,21 @@ NH_abort(char *why USED_FOR_CRASHREPORT) #endif { #ifndef VMS - if (gdb_prio == libc_prio && gdb_prio > 0) - gdb_prio++; + if (gdb_prio == libc_prio && gdb_prio > 0) + gdb_prio++; - if (gdb_prio > libc_prio) { - (void) (NH_panictrace_gdb() || (libc_prio && NH_panictrace_libc())); - } else { - (void) (NH_panictrace_libc() || (gdb_prio && NH_panictrace_gdb())); - } + if (gdb_prio > libc_prio) { + (void) (NH_panictrace_gdb() || (libc_prio && NH_panictrace_libc())); + } else { + (void) (NH_panictrace_libc() || (gdb_prio && NH_panictrace_gdb())); + } #else /* VMS */ - /* overload otherwise unused priority for debug mode: 1 = show - traceback and exit; 2 = show traceback and stay in debugger */ - /* if (wizard && gdb_prio == 1) gdb_prio = 2; */ - vms_traceback(gdb_prio); - nhUse(libc_prio); + /* overload otherwise unused priority for debug mode: 1 = show + traceback and exit; 2 = show traceback and stay in debugger */ + /* if (wizard && gdb_prio == 1) gdb_prio = 2; */ + vms_traceback(gdb_prio); + nhUse(libc_prio); #endif /* ?VMS */ } @@ -241,83 +241,89 @@ NH_abort(char *why USED_FOR_CRASHREPORT) # include # define HASH_CONTEXTPTR(CTXP) \ unsigned char tmp[CC_MD4_DIGEST_LENGTH]; \ - CC_MD4_CTX CTXP ## _; \ + CC_MD4_CTX CTXP ## _; \ CC_MD4_CTX *CTXP = &CTXP ## _ # define HASH_INIT(ctxp) !CC_MD4_Init(ctxp) # define HASH_UPDATE(ctx, ptr, len) !CC_MD4_Update(ctx, ptr, len) # define HASH_FINISH(ctxp) !CC_MD4_Final(tmp, ctxp) # define HASH_RESULT_SIZE(ctxp) CC_MD4_DIGEST_LENGTH -# define HASH_RESULT(ctx, inp) *inp = (unsigned char *)ctx +# define HASH_RESULT(ctx, inp) *inp = (unsigned char *) ctx # define HASH_CLEANUP(ctxp) # define HASH_OFLAGS O_RDONLY # define HASH_BINFILE_DECL char *binfile = argv[0]; # ifdef BETA # define HASH_BINFILE \ - if (!binfile || !*binfile) { \ - /* If this triggers, investigate CFBundleGetMainBundle */ \ - /* or CFBundleCopyExecutableURL. */ \ - raw_print("BETA warning: crashreport_init called without useful info"); \ - goto skip; \ + if (!binfile || !*binfile) { \ + /* If this triggers, investigate CFBundleGetMainBundle */ \ + /* or CFBundleCopyExecutableURL. */ \ + raw_print( \ + "BETA warning: crashreport_init called without useful info"); \ + goto skip; \ } # else # define HASH_BINFILE() \ - if (!binfile || !*binfile) { \ - goto skip; \ - } + if (!binfile || !*binfile) { \ + goto skip; \ + } # endif # endif # ifdef __linux__ # include "nhmd4.h" # define HASH_CONTEXTPTR(CTXP) \ - unsigned char tmp[NHMD4_DIGEST_LENGTH]; \ - NHMD4_CTX CTXP ## _; \ - NHMD4_CTX *CTXP = &CTXP ## _ -# define HASH_INIT(ctxp) (nhmd4_init(ctxp),0) -# define HASH_UPDATE(ctx, ptr, len) (nhmd4_update(ctx, ptr, len),0) -# define HASH_FINISH(ctxp) (nhmd4_final(ctxp, tmp),0) + unsigned char tmp[NHMD4_DIGEST_LENGTH]; \ + NHMD4_CTX CTXP ## _; \ + NHMD4_CTX *CTXP = &CTXP ## _ +# define HASH_INIT(ctxp) (nhmd4_init(ctxp), 0) +# define HASH_UPDATE(ctx, ptr, len) (nhmd4_update(ctx, ptr, len), 0) +# define HASH_FINISH(ctxp) (nhmd4_final(ctxp, tmp), 0) # define HASH_RESULT_SIZE(ctxp) NHMD4_RESULTLEN # define HASH_RESULT(ctx, inp) *inp = tmp # define HASH_CLEANUP(ctxp) # define HASH_OFLAGS O_RDONLY # define HASH_BINFILE_DECL char binfile[PATH_MAX+1]; # define HASH_BINFILE() \ - int len = readlink("/proc/self/exe", binfile, sizeof(binfile)-1); \ - if (len>0) { \ - binfile[len] = '\0'; \ - } else { \ - goto skip; \ - } + int len = readlink("/proc/self/exe", binfile, sizeof binfile - 1); \ + if (len > 0) { \ + binfile[len] = '\0'; \ + } else { \ + goto skip; \ + } # endif // __linux__ # ifdef WIN32 /* WIN32 takes too much code and is dependent on OS includes we can't * pull in here, so we call out to code in sys/windows/windsys.c */ # define HASH_CONTEXTPTR(CTXP) -# define HASH_INIT(ctxp) win32_cr_helper('i',ctxp, NULL, 0) -# define HASH_UPDATE(ctxp, ptr, len) win32_cr_helper('u',ctxp, ptr, len) -# define HASH_FINISH(ctxp) win32_cr_helper('f',ctxp,NULL,0) -# define HASH_CLEANUP(ctxp) win32_cr_helper('c',ctxp, NULL, 0) -# define HASH_RESULT_SIZE(ctxp) win32_cr_helper('s',ctxp,NULL,0) -# define HASH_RESULT(ctxp, inp) win32_cr_helper('r',ctxp,inp,0) +# define HASH_INIT(ctxp) win32_cr_helper('i', ctxp, NULL, 0) +# define HASH_UPDATE(ctxp, ptr, len) win32_cr_helper('u', ctxp, ptr, len) +# define HASH_FINISH(ctxp) win32_cr_helper('f', ctxp, NULL, 0) +# define HASH_CLEANUP(ctxp) win32_cr_helper('c', ctxp, NULL, 0) +# define HASH_RESULT_SIZE(ctxp) win32_cr_helper('s', ctxp, NULL, 0) +# define HASH_RESULT(ctxp, inp) win32_cr_helper('r', ctxp, inp, 0) # define HASH_OFLAGS _O_RDONLY | _O_BINARY # define HASH_BINFILE_DECL char *binfile; # define HASH_BINFILE() \ - if(win32_cr_helper('b',NULL,&binfile,0)){ \ - goto skip; \ - } + if (win32_cr_helper('b', NULL, &binfile, 0)) { \ + goto skip; \ + } # endif // WIN32 -// Binary ID - Use only as a hint to contact.html for recognizing our own -// binaries. This is easily spoofed! + +/* Binary ID - Use only as a hint to contact.html for recognizing our own + binaries. This is easily spoofed! */ static char bid[40]; /* ARGSUSED */ void -crashreport_init(int argc UNUSED, char *argv[] UNUSED){ - static int once=0; if(once++) return; // NetHackW.exe calls us twice +crashreport_init(int argc UNUSED, char *argv[] UNUSED) +{ + static int once = 0; + if (once++) /* NetHackW.exe calls us twice */ + return; HASH_BINFILE_DECL; HASH_PRAGMA_START HASH_CONTEXTPTR(ctxp); - if(HASH_INIT(ctxp)) goto skip; - HASH_BINFILE(); // Does "goto skip" on error. + if (HASH_INIT(ctxp)) + goto skip; + HASH_BINFILE(); /* Does "goto skip" on error. */ int fd = open(binfile, HASH_OFLAGS, 0); if (fd == -1) { @@ -330,28 +336,39 @@ crashreport_init(int argc UNUSED, char *argv[] UNUSED){ int segsize; unsigned char segment[4096]; - while (0 < (segsize = read(fd, segment,sizeof(segment)))) { - if(HASH_UPDATE(ctxp, segment, segsize)) goto skip; + while (0 < (segsize = read(fd, segment, sizeof segment))) { + if (HASH_UPDATE(ctxp, segment, segsize)) + goto skip; } - if(segsize < 0) { + if (segsize < 0) { close(fd); goto skip; } - if(HASH_FINISH(ctxp)) goto skip; + if (HASH_FINISH(ctxp)) + goto skip; close(fd); + static const char hex[] = "0123456789abcdef"; char *p = bid; unsigned char *in; - HASH_RESULT(ctxp,&in); - /* Just in case, make sure not to overflow the bid buffer. */ - char cnt=min(HASH_RESULT_SIZE(ctxp), (sizeof(bid)-1)); - while (cnt--) { - p += snprintf(p, HASH_RESULT_SIZE(ctxp) - (p - bid), "%02x", *(in++)); + HASH_RESULT(ctxp, &in); + uint8 cnt = (uint8) HASH_RESULT_SIZE(ctxp); + /* Just in case, make sure not to overflow the bid buffer. + Divide size by 2 because each octet in the hash uses two slots + in bid[] when formatted as a pair of hexadecimal digits. */ + if (cnt >= (uint8) sizeof bid / 2) + cnt = (uint8) sizeof bid / 2 - 1; + while (cnt) { + /* sprintf(p, "%02x", *in++), p += 2; */ + *p++ = hex[(*in >> 4) & 0x0f]; + *p++ = hex[*in++ & 0x0f]; + --cnt; } *p = '\0'; return; -skip: - strncpy((char *)bid,"unknown",sizeof(bid)-1); + + skip: + Strcpy(bid, "unknown"); HASH_CLEANUP(ctxp); HASH_PRAGMA_END } @@ -368,9 +385,10 @@ skip: #undef HASH_BINFILE void -crashreport_bidshow(void){ +crashreport_bidshow(void) +{ #if defined(WIN32) && !defined(WIN32CON) - if(0==win32_cr_helper('D', ctxp, bid, 0)) + if (0 == win32_cr_helper('D', ctxp, bid, 0)) #endif { raw_print(bid); @@ -398,40 +416,42 @@ crashreport_bidshow(void){ // then we can remove the whole item if desired. For other // semantics, caller can handle mark. #define SWR_ADD(str) \ - utmp = strlen(str); \ - mark = uend; \ - if(utmp >= urem) goto full; \ - strncpy(uend, str, utmp); \ - uend += utmp; urem -= utmp; \ + utmp = strlen(str); \ + mark = uend; \ + if (utmp >= urem) \ + goto full; \ + strncpy(uend, str, utmp); \ + uend += utmp; urem -= utmp; \ *uend = '\0'; // NB: on overflow this rolls us back to mark, so if we don't // want to roll back to the last SWR_ADD, update mark before // calling this macro. #define SWR_ADD_URIcoded(str) \ - if(swr_add_uricoded(str, &uend, &urem, mark))goto full; + if (swr_add_uricoded(str, &uend, &urem, mark)) \ + goto full; -// On overflow, truncate to markp (but only if markp != NULL). +/* On overflow, truncate to markp (but only if markp != NULL). */ boolean -swr_add_uricoded(const char *in, char **out, int *remaining, char *markp){ - while(*in){ - if( - isalnum(*in) || - *in == '_' || - *in == '-' || - *in == '.' || - *in == '~' // || - ){ +swr_add_uricoded( + const char *in, + char **out, + int *remaining, + char *markp) +{ + while (*in) { + if (isalnum(*in) || strchr("_-.~", *in)) { **out = *in; (*out)++; (*remaining)--; - } else if(*in == ' '){ + } else if (*in == ' ') { **out = '+'; (*out)++; (*remaining)--; } else { - if(*remaining <= 3){ - if(markp) *out = markp, *remaining = 0; + if (*remaining <= 3) { + if (markp) + *out = markp, *remaining = 0; **out = '\0'; return TRUE; } @@ -440,14 +460,15 @@ swr_add_uricoded(const char *in, char **out, int *remaining, char *markp){ *remaining -= x; } in++; - if(! *remaining){ - if(markp) *out = markp, *remaining = 0; + if (!*remaining) { + if (markp) + *out = markp, *remaining = 0; **out = '\0'; return TRUE; } **out = '\0'; } - return FALSE; // normal return + return FALSE; /* normal return */ } static char url[MAX_URL]; // XXX too bad this isn't allocated as needed @@ -457,37 +478,39 @@ static int utmp; // used inside macros static char *mark; // holds previous terminator (generally) boolean -submit_web_report(int cos, const char *msg, const char *why){ +submit_web_report(int cos, const char *msg, const char *why) +{ urem = (gc.crash_urlmax < 0 || gc.crash_urlmax > MAX_URL) ? MAX_URL : min(MAX_URL,gc.crash_urlmax); char temp[200]; char temp2[200]; - int countpp=0; // pre and post traceback lines + int countpp = 0; /* pre and post traceback lines */ // URL loaded for creating reports to the NetHack DevTeam // CRASHREPORTURL=https://nethack.org/links/cr-37BETA.html - if(!sysopt.crashreporturl) return FALSE; + if (!sysopt.crashreporturl) + return FALSE; SWR_ADD(sysopt.crashreporturl); /* cos - operation, v - version */ - snprintf(temp, sizeof(temp), "?cos=%d&v=1",cos); + Snprintf(temp, sizeof temp, "?cos=%d&v=1", cos); SWR_ADD(temp); - /* msg==NULL for #bugreport */ - if(msg){ - SWR_ADD("&subject="); - snprintf(temp, sizeof(temp), "%s report for NetHack %s", - msg, version_string(temp2, sizeof(temp2))); - SWR_ADD_URIcoded(temp); + /* msg==NULL for #bugreport */ + if (msg) { + SWR_ADD("&subject="); + Snprintf(temp, sizeof temp, "%s report for NetHack %s", + msg, version_string(temp2, sizeof temp2 )); + SWR_ADD_URIcoded(temp); } SWR_ADD("&gitver="); - SWR_ADD_URIcoded(getversionstring(temp2, sizeof(temp2))); + SWR_ADD_URIcoded(getversionstring(temp2, sizeof temp2)); - if(gc.crash_name){ + if (gc.crash_name) { SWR_ADD("&name="); SWR_ADD_URIcoded(gc.crash_name); } - if(gc.crash_email){ + if(gc.crash_email) { SWR_ADD("&email="); SWR_ADD_URIcoded(gc.crash_email); } @@ -499,21 +522,21 @@ submit_web_report(int cos, const char *msg, const char *why){ if (why) { SWR_ADD_URIcoded(why); SWR_ADD_URIcoded("\n"); - mark=uend; + mark = uend; countpp++; } SWR_ADD_URIcoded("bid: "); SWR_ADD_URIcoded(bid); SWR_ADD_URIcoded("\n"); - mark=uend; + mark = uend; countpp++; int count = 0; - if(cos==1){ + if (cos == 1) { #ifdef WIN32 - count=win32_cr_gettrace(SWR_FRAMES,uend, MAX_URL-(uend-url)); - uend=eos(url); + count = win32_cr_gettrace(SWR_FRAMES, uend, MAX_URL - (uend - url)); + uend = eos(url); #else void *bt[SWR_FRAMES]; int x; @@ -522,38 +545,39 @@ submit_web_report(int cos, const char *msg, const char *why){ count = backtrace(bt, SIZE(bt)); info = backtrace_symbols(bt, count); for (x = 0; x < count; x++) { - copynchars(temp, info[x], (int) sizeof temp - 1 - 1); // \n\0 - /* try to remove up to 16 blank spaces by removing 8 twice */ + copynchars(temp, info[x], (int) sizeof temp - 1 - 1); /* \n\0 */ + /* try to remove up to 16 blank spaces by removing 8 twice */ (void) strsubst(temp, " ", ""); (void) strsubst(temp, " ", ""); - strncat(temp, "\n", sizeof temp - 1); + (void) strncat(temp, "\n", sizeof temp - 1); # if 0 // __linux__ // not needed for MacOS // XXX is it actually needed for linux? TBD - snprintf(temp2, sizeof(temp2), "[%02lu]\n", (unsigned long) x); + Snprintf(temp2, sizeof temp2, "[%02lu]\n", (unsigned long) x); uend--; // remove the \n we added above SWR_ADD_URIcoded(temp2); # endif // linux - SWR_ADD_URIcoded(temp); - mark=uend; + SWR_ADD_URIcoded(temp); + mark = uend; } #endif // !WIN32 } #ifdef DUMPLOG_CORE // config.h turns this on, but make it easy to turn off if needed - if(cos==1) { + if (cos == 1) { int k; SWR_ADD_URIcoded("Latest messages:\n"); mark=uend; countpp++; - for(k=0;k<5;k++){ + for (k = 0; k < 5; k++) { const char *line = get_saved_pline(k); - if(!line) break; + if (!line) + break; SWR_ADD_URIcoded(line); SWR_ADD_URIcoded("\n"); countpp++; - mark=uend; + mark = uend; } } #endif @@ -561,10 +585,11 @@ submit_web_report(int cos, const char *msg, const char *why){ // detailrows: Guess since we can't know the // width of the window. SWR_ADD("&detailrows="); - (void)snprintf(temp,sizeof(temp),"%d",min(count+countpp,30)); + Snprintf(temp, sizeof temp, "%d", min(count + countpp, 30)); SWR_ADD_URIcoded(temp); -full: ; + full: + ; //printf("URL=%ld '%s'\n",strlen(url),url); #ifdef WIN32 int *rv = win32_cr_shellexecute(url); @@ -583,8 +608,8 @@ printf("ShellExecute returned: %p\n",rv); // >32 is ok #ifdef CRASHREPORT_EXEC_NOSTDERR /* Keep the output clean - firefox spews useless errors on * my system. */ - (void)close(2); - (void)open("/dev/null", O_WRONLY); + (void) close(2); + (void) open("/dev/null", O_WRONLY); #endif (void) execve(CRASHREPORT, (char * const *) xargv, environ); @@ -592,7 +617,7 @@ printf("ShellExecute returned: %p\n",rv); // >32 is ok raw_print(err); } else { int status; - errno=0; + errno = 0; (void) waitpid(pid, &status, 0); if (status) { /* XXX check could be more precise */ #ifdef BETA @@ -611,10 +636,11 @@ printf("ShellExecute returned: %p\n",rv); // >32 is ok } int -dobugreport(void){ - if(!submit_web_report(2, NULL, "#bugreport command")){ +dobugreport(void) +{ + if (!submit_web_report(2, NULL, "#bugreport command")) { pline("Unable to send bug report. Please visit %s instead.", - sysopt.crashreporturl + (sysopt.crashreporturl && *sysopt.crashreporturl) ? sysopt.crashreporturl : "https://www.nethack.org" ); @@ -633,7 +659,7 @@ dobugreport(void){ static boolean NH_panictrace_libc(void) { -#if 0 /* XXX how did this get left here? */ +#if 0 /* XXX how did this get left here? */ #ifdef CRASHREPORT if (submit_web_report("Panic", why)) return TRUE; @@ -1197,19 +1223,21 @@ dump_plines(void) #endif /* DUMPLOG */ #ifdef CRASHREPORT -// lineno==0 gives the most recent message (e.g. "Do you want to call panic..." -// if called from #panic) +/* lineno==0 gives the most recent message (e.g. + "Do you want to call panic..." if called from #panic) */ static const char * -get_saved_pline(int lineno){ +get_saved_pline(int lineno) +{ int p; int limit = DUMPLOG_MSG_COUNT; - if(lineno >= DUMPLOG_MSG_COUNT) return NULL; - p = (gs.saved_pline_index-1) % DUMPLOG_MSG_COUNT; + if (lineno >= DUMPLOG_MSG_COUNT) + return NULL; + p = (gs.saved_pline_index - 1) % DUMPLOG_MSG_COUNT; - while(limit--){ - if(gs.saved_plines[p]){ // valid line - if(lineno--){ - p = (p-1+DUMPLOG_MSG_COUNT) % DUMPLOG_MSG_COUNT; + while (limit--) { + if (gs.saved_plines[p]) { /* valid line */ + if (lineno--) { + p = (p - 1 + DUMPLOG_MSG_COUNT) % DUMPLOG_MSG_COUNT; } else { return gs.saved_plines[p]; } From 79867d78c83843aa2380f80067aed08d938f65b5 Mon Sep 17 00:00:00 2001 From: nhkeni Date: Tue, 5 Mar 2024 13:21:56 -0500 Subject: [PATCH 2/3] Two new features primarily in Makefile.src: NOSTATICCORE - an option for Linux to get a better backtrace updatedepend - an easier alternative to "make depend" - .gitignore: ignore new temporary .*.c files - hints/linux.370: add NOSTATICCORE and instructions - Makefile.src: -- If NOSTATICCORE defined, run core .c files through awk to remove static attribute from functions. -- add updatedepend target and related bits --- src/.gitignore | 1 + sys/unix/Makefile.src | 572 +++++++++++++++++++++------------------ sys/unix/hints/linux.370 | 5 + 3 files changed, 316 insertions(+), 262 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index 5425397ab..9343f331b 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -30,3 +30,4 @@ objpdc/* bundle/* Makefile.mingw32 Makefile.mingw32.depend +.*.c diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index f682444f8..dd2d94d2c 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -439,9 +439,26 @@ QUIETCC=0 # Other things that have to be reconfigured are in config.h, # {unixconf.h, pcconf.h}, and possibly cstd.h -# Add rule for possible cross-compiler + +# NB: This is not used for all .c files (see explicit rules in +# dependencies). +ifndef NOSTATICCORE + # A normal or cross compile. $(TARGETPFX)%.o : %.c $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ $< +else + # NOSTATICCORE: A compile that makes all functions non-static. + # Rule /=/ allows 2 definitions of char array brief_feeling +$(TARGETPFX)%.o : %.c + awk ' \ + BEGIN{print "#line 1 \"$<\""} \ + /=/{print;next} \ + sub(/^static inline/, "") \ + sub(/^static( |$$)/, "") \ + ' < $< > .$< + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ .$< +endif + # Verbosity definitions, begin # Set QUIETCC=1 above to output less feedback while building. @@ -485,6 +502,7 @@ LUA_VERSION ?=5.4.6 LUABASE = liblua-$(LUA_VERSION).a LUALIB = ../lib/lua/$(LUABASE) LUALIBS = $(LUALIB) -lm $(DLLIB) +LUAHEADERS = lib/lua-$(LUA_VERSION)/src # timestamp files to reduce `make' overhead and shorten .o dependency lists CONFIG_H = ../src/config.h-t @@ -785,6 +803,34 @@ package: $(PACKAGE) @echo packaging complete. +# A more automated "make depend" target +# cd sys/unix ; make -f Makefile.src updatedepend +updatedepend: updatedepend-setup + cp Makefile.src ../../src && \ + make -C ../../src MAKEFILE_NAME=Makefile.src -f Makefile.src depend && \ + mv ../../src/Makefile.src . + +# check pwd, create bogus derived files +updatedepend-setup: + @ # make sure we're in sys/unix before we start writing + @p=`pwd`; \ + if [ $$p = $${p%/sys/unix} ]; then \ + echo "updatedepend must be run in sys/unix"; exit 1; \ + fi + @ # generate bogus files + echo "Generating bogus include/nhlua.h" + (HFILE=../../include/nhlua.h && \ + echo '/* bogus nhlua.h for updatedepend ONLY */' > $$HFILE && \ + echo '#error bogus include/nhlua.h' >> $$HFILE && \ + echo '#include "../$(LUAHEADERS)/lua.h"' >> $$HFILE && \ + echo '#include "../$(LUAHEADERS)/lualib.h"' >> $$HFILE && \ + echo '#include "../$(LUAHEADERS)/lauxlib.h"' >> $$HFILE && \ + echo '/*nhlua.h*/' >> $$HFILE ) + @echo "Generating bogus src/tile.c" + @echo '#error bogus include/nhlua.h' > ../../src/tile.c + @echo "#include \"hack.h\"" >> ../../src/tile.c + +MAKEFILE_NAME=Makefile depend: ../sys/unix/depend.awk \ $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ $(CHAINSRC) $(GENCSRC) $(HACKCSRC) @@ -794,44 +840,49 @@ depend: ../sys/unix/depend.awk \ @echo '/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/+2,$$d' >eddep @echo '$$r makedep' >>eddep @echo 'w' >>eddep - @cp Makefile Makefile.bak - ed - Makefile < eddep + @cp $(MAKEFILE_NAME) Makefile.bak + @ed - $(MAKEFILE_NAME) < eddep @rm -f eddep makedep - @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile - @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile - @echo '# see make depend above' >> Makefile - - diff Makefile.bak Makefile + @echo '# DEPENDENCIES MUST END AT END OF FILE' >> $(MAKEFILE_NAME) + @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> $(MAKEFILE_NAME) + @echo '# see make depend above' >> $(MAKEFILE_NAME) + - diff Makefile.bak $(MAKEFILE_NAME) @rm -f Makefile.bak + @rm -f ../include/nhlua.h tile.c # DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT # config.h timestamp -$(CONFIG_H): ../include/config.h ../include/config1.h ../include/patchlevel.h \ - ../include/tradstdc.h ../include/cstd.h ../include/integer.h \ - ../include/global.h ../include/coord.h ../include/vmsconf.h \ - ../include/unixconf.h ../include/pcconf.h ../include/micro.h \ - ../include/windconf.h ../include/warnings.h \ - ../include/fnamesiz.h +$(CONFIG_H): ../include/color.h ../include/config.h ../include/config1.h \ + ../include/coord.h ../include/cstd.h ../include/fnamesiz.h \ + ../include/global.h ../include/integer.h ../include/micro.h \ + ../include/patchlevel.h ../include/pcconf.h \ + ../include/tradstdc.h ../include/unixconf.h \ + ../include/vmsconf.h ../include/warnings.h \ + ../include/windconf.h touch $(CONFIG_H) # hack.h timestamp -$(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/color.h \ - ../include/align.h ../include/dungeon.h ../include/objclass.h \ - ../include/defsym.h ../include/objects.h ../include/wintype.h \ - ../include/flag.h ../include/rect.h ../include/sym.h \ - ../include/trap.h ../include/youprop.h ../include/prop.h \ - ../include/permonst.h ../include/monsters.h \ - ../include/monattk.h ../include/monflag.h \ - ../include/mondata.h ../include/display.h ../include/vision.h \ - ../include/botl.h ../include/context.h ../include/engrave.h \ - ../include/mkroom.h ../include/obj.h ../include/quest.h \ - ../include/region.h ../include/rm.h ../include/sndprocs.h \ - ../include/seffects.h ../include/spell.h ../include/sys.h \ - ../include/timeout.h ../include/winprocs.h ../include/you.h \ - ../include/attrib.h ../include/monst.h ../include/mextra.h \ - ../include/skills.h ../include/artilist.h ../include/nhlua.h \ - ../include/decl.h +$(HACK_H): $(CONFIG_H) ../include/align.h ../include/artilist.h \ + ../include/attrib.h ../include/botl.h ../include/context.h \ + ../include/decl.h ../include/defsym.h ../include/display.h \ + ../include/dungeon.h ../include/engrave.h ../include/flag.h \ + ../include/hack.h ../include/lint.h ../include/mextra.h \ + ../include/mkroom.h ../include/monattk.h ../include/mondata.h \ + ../include/monflag.h ../include/monst.h ../include/monsters.h \ + ../include/nhlua.h ../include/obj.h ../include/objclass.h \ + ../include/objects.h ../include/permonst.h ../include/prop.h \ + ../include/quest.h ../include/rect.h ../include/region.h \ + ../include/rm.h ../include/seffects.h ../include/skills.h \ + ../include/sndprocs.h ../include/spell.h ../include/sym.h \ + ../include/sys.h ../include/timeout.h ../include/trap.h \ + ../include/vision.h ../include/winprocs.h \ + ../include/wintype.h ../include/you.h ../include/youprop.h touch $(HACK_H) # +$(TARGETPFX)cppregex.o: ../sys/share/cppregex.cpp $(CONFIG_H) + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../sys/share/cppregex.cpp +$(TARGETPFX)ioctl.o: ../sys/share/ioctl.c $(HACK_H) ../include/tcap.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/ioctl.c $(TARGETPFX)pcmain.o: ../sys/share/pcmain.c $(HACK_H) ../include/dlb.h $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/pcmain.c $(TARGETPFX)pcsys.o: ../sys/share/pcsys.c $(HACK_H) ../include/wintty.h @@ -846,71 +897,154 @@ $(TARGETPFX)posixregex.o: ../sys/share/posixregex.c $(HACK_H) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/posixregex.c $(TARGETPFX)random.o: ../sys/share/random.c $(HACK_H) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/random.c -$(TARGETPFX)ioctl.o: ../sys/share/ioctl.c $(HACK_H) ../include/tcap.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/ioctl.c $(TARGETPFX)unixtty.o: ../sys/share/unixtty.c $(HACK_H) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/share/unixtty.c $(TARGETPFX)unixmain.o: ../sys/unix/unixmain.c $(HACK_H) ../include/dlb.h $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/unix/unixmain.c -$(TARGETPFX)unixunix.o: ../sys/unix/unixunix.c $(HACK_H) - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/unix/unixunix.c $(TARGETPFX)unixres.o: ../sys/unix/unixres.c $(CONFIG_H) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/unix/unixres.c -$(TARGETPFX)getline.o: ../win/tty/getline.c $(HACK_H) ../include/wintty.h \ - ../include/func_tab.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/getline.c -$(TARGETPFX)termcap.o: ../win/tty/termcap.c $(HACK_H) ../include/wintty.h \ - ../include/tcap.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/termcap.c -$(TARGETPFX)topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h \ - ../include/wintty.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/topl.c -$(TARGETPFX)wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h \ - ../include/tcap.h ../include/wintty.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/wintty.c -$(TARGETPFX)cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/wincurs.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmain.c -$(TARGETPFX)curswins.o: ../win/curses/curswins.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/curswins.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/curswins.c -$(TARGETPFX)cursmisc.o: ../win/curses/cursmisc.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursmisc.h \ - ../include/func_tab.h ../include/dlb.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmisc.c -$(TARGETPFX)cursdial.o: ../win/curses/cursdial.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursdial.h \ - ../include/func_tab.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursdial.c -$(TARGETPFX)cursstat.o: ../win/curses/cursstat.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursstat.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursstat.c -$(TARGETPFX)cursinit.o: ../win/curses/cursinit.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursinit.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursinit.c -$(TARGETPFX)cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursmesg.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmesg.c -$(TARGETPFX)cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) \ - ../include/wincurs.h ../win/curses/cursinvt.h - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursinvt.c -$(TARGETPFX)Window.o: ../win/X11/Window.c ../include/xwindowp.h \ - ../include/xwindow.h $(CONFIG_H) ../include/lint.h \ - ../include/winX.h ../include/color.h ../include/wintype.h +$(TARGETPFX)unixunix.o: ../sys/unix/unixunix.c $(HACK_H) + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../sys/unix/unixunix.c +$(TARGETPFX)qt_bind.o: ../win/Qt/qt_bind.cpp $(HACK_H) $(QTn_H) \ + ../include/dlb.h ../win/Qt/qt_bind.h ../win/Qt/qt_click.h \ + ../win/Qt/qt_clust.h ../win/Qt/qt_delay.h ../win/Qt/qt_icon.h \ + ../win/Qt/qt_kde0.h ../win/Qt/qt_key.h ../win/Qt/qt_line.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_map.h ../win/Qt/qt_menu.h \ + ../win/Qt/qt_msg.h ../win/Qt/qt_plsel.h ../win/Qt/qt_post.h \ + ../win/Qt/qt_pre.h ../win/Qt/qt_rip.h ../win/Qt/qt_set.h \ + ../win/Qt/qt_stat.h ../win/Qt/qt_str.h ../win/Qt/qt_streq.h \ + ../win/Qt/qt_svsel.h ../win/Qt/qt_win.h ../win/Qt/qt_xcmd.h \ + ../win/Qt/qt_yndlg.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_bind.cpp +$(TARGETPFX)qt_click.o: ../win/Qt/qt_click.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_click.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_click.cpp +$(TARGETPFX)qt_clust.o: ../win/Qt/qt_clust.cpp $(QTn_H) ../win/Qt/qt_clust.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_clust.cpp +$(TARGETPFX)qt_delay.o: ../win/Qt/qt_delay.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_delay.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_delay.cpp +$(TARGETPFX)qt_glyph.o: ../win/Qt/qt_glyph.cpp $(HACK_H) $(QTn_H) \ + ../include/tile2x11.h ../win/Qt/qt_bind.h \ + ../win/Qt/qt_clust.h ../win/Qt/qt_glyph.h ../win/Qt/qt_inv.h \ + ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h ../win/Qt/qt_map.h \ + ../win/Qt/qt_post.h ../win/Qt/qt_pre.h ../win/Qt/qt_set.h \ + ../win/Qt/qt_str.h ../win/Qt/qt_win.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_glyph.cpp +$(TARGETPFX)qt_icon.o: ../win/Qt/qt_icon.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_icon.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_str.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_icon.cpp +$(TARGETPFX)qt_inv.o: ../win/Qt/qt_inv.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.h ../win/Qt/qt_inv.h \ + ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h ../win/Qt/qt_post.h \ + ../win/Qt/qt_pre.h ../win/Qt/qt_set.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_inv.cpp +$(TARGETPFX)qt_key.o: ../win/Qt/qt_key.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_key.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_key.cpp +$(TARGETPFX)qt_line.o: ../win/Qt/qt_line.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_line.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_line.cpp +$(TARGETPFX)qt_main.o: ../win/Qt/qt_main.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_clust.h ../win/Qt/qt_glyph.h \ + ../win/Qt/qt_icon.h ../win/Qt/qt_inv.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_key.h ../win/Qt/qt_main.h ../win/Qt/qt_map.h \ + ../win/Qt/qt_msg.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_stat.h ../win/Qt/qt_str.h \ + ../win/Qt/qt_win.h qt_kde0.moc qt_main.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_main.cpp +$(TARGETPFX)qt_map.o: ../win/Qt/qt_map.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_click.h ../win/Qt/qt_clust.h \ + ../win/Qt/qt_glyph.h ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h \ + ../win/Qt/qt_map.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_str.h ../win/Qt/qt_win.h \ + qt_map.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_map.cpp +$(TARGETPFX)qt_menu.o: ../win/Qt/qt_menu.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_key.h ../win/Qt/qt_line.h ../win/Qt/qt_main.h \ + ../win/Qt/qt_menu.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_rip.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h \ + ../win/Qt/qt_streq.h ../win/Qt/qt_win.h qt_menu.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_menu.cpp +$(TARGETPFX)qt_msg.o: ../win/Qt/qt_msg.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_clust.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_map.h ../win/Qt/qt_msg.h \ + ../win/Qt/qt_post.h ../win/Qt/qt_pre.h ../win/Qt/qt_set.h \ + ../win/Qt/qt_str.h ../win/Qt/qt_win.h qt_msg.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_msg.cpp +$(TARGETPFX)qt_plsel.o: ../win/Qt/qt_plsel.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_plsel.h ../win/Qt/qt_post.h \ + ../win/Qt/qt_pre.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h \ + qt_plsel.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_plsel.cpp +$(TARGETPFX)qt_rip.o: ../win/Qt/qt_rip.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h \ + ../win/Qt/qt_post.h ../win/Qt/qt_pre.h ../win/Qt/qt_rip.h \ + ../win/Qt/qt_str.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_rip.cpp +$(TARGETPFX)qt_set.o: ../win/Qt/qt_set.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_str.h ../win/Qt/qt_xcmd.h \ + qt_set.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_set.cpp +$(TARGETPFX)qt_stat.o: ../win/Qt/qt_stat.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_icon.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_stat.h ../win/Qt/qt_str.h \ + ../win/Qt/qt_win.h ../win/Qt/qt_xpms.h qt_stat.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_stat.cpp +$(TARGETPFX)qt_str.o: ../win/Qt/qt_str.cpp $(QTn_H) ../win/Qt/qt_str.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_str.cpp +$(TARGETPFX)qt_streq.o: ../win/Qt/qt_streq.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h ../win/Qt/qt_line.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_str.h ../win/Qt/qt_streq.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_streq.cpp +$(TARGETPFX)qt_svsel.o: ../win/Qt/qt_svsel.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h \ + ../win/Qt/qt_post.h ../win/Qt/qt_pre.h ../win/Qt/qt_str.h \ + ../win/Qt/qt_svsel.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_svsel.cpp +$(TARGETPFX)qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_bind.h ../win/Qt/qt_click.h ../win/Qt/qt_clust.h \ + ../win/Qt/qt_glyph.h ../win/Qt/qt_icon.h ../win/Qt/qt_inv.h \ + ../win/Qt/qt_kde0.h ../win/Qt/qt_key.h ../win/Qt/qt_main.h \ + ../win/Qt/qt_map.h ../win/Qt/qt_menu.h ../win/Qt/qt_msg.h \ + ../win/Qt/qt_post.h ../win/Qt/qt_pre.h ../win/Qt/qt_rip.h \ + ../win/Qt/qt_set.h ../win/Qt/qt_win.h + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_win.cpp +$(TARGETPFX)qt_xcmd.o: ../win/Qt/qt_xcmd.cpp $(HACK_H) $(QTn_H) \ + ../include/func_tab.h ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_key.h ../win/Qt/qt_main.h ../win/Qt/qt_post.h \ + ../win/Qt/qt_pre.h ../win/Qt/qt_set.h ../win/Qt/qt_str.h \ + ../win/Qt/qt_xcmd.h qt_xcmd.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_xcmd.cpp +$(TARGETPFX)qt_yndlg.o: ../win/Qt/qt_yndlg.cpp $(HACK_H) $(QTn_H) \ + ../win/Qt/qt_key.h ../win/Qt/qt_post.h ../win/Qt/qt_pre.h \ + ../win/Qt/qt_str.h ../win/Qt/qt_yndlg.h qt_yndlg.moc + $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../win/Qt/qt_yndlg.cpp +$(TARGETPFX)Window.o: ../win/X11/Window.c $(CONFIG_H) ../include/lint.h \ + ../include/winX.h ../include/wintype.h ../include/xwindow.h \ + ../include/xwindowp.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/Window.c $(TARGETPFX)dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) ../include/lint.h \ - ../include/winX.h ../include/color.h ../include/wintype.h + ../include/winX.h ../include/wintype.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/dialogs.c -$(TARGETPFX)winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h \ - ../include/dlb.h ../include/xwindow.h ../win/X11/nh72icon \ - ../win/X11/nh56icon ../win/X11/nh32icon +$(TARGETPFX)winX.o: ../win/X11/winX.c $(HACK_H) ../include/dlb.h \ + ../include/winX.h ../include/xwindow.h ../win/X11/nh32icon \ + ../win/X11/nh56icon ../win/X11/nh72icon $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/winX.c -$(TARGETPFX)winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) \ - ../include/dlb.h ../include/winX.h ../include/tile2x11.h +$(TARGETPFX)winmap.o: ../win/X11/winmap.c $(HACK_H) ../include/dlb.h \ + ../include/tile2x11.h ../include/winX.h ../include/xwindow.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/winmap.c $(TARGETPFX)winmenu.o: ../win/X11/winmenu.c $(HACK_H) ../include/winX.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/winmenu.c -$(TARGETPFX)winmesg.o: ../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) \ - ../include/winX.h +$(TARGETPFX)winmesg.o: ../win/X11/winmesg.c $(HACK_H) ../include/winX.h \ + ../include/xwindow.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/winmesg.c $(TARGETPFX)winmisc.o: ../win/X11/winmisc.c $(HACK_H) ../include/func_tab.h \ ../include/winX.h @@ -923,162 +1057,52 @@ $(TARGETPFX)wintext.o: ../win/X11/wintext.c $(HACK_H) ../include/winX.h \ $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/wintext.c $(TARGETPFX)winval.o: ../win/X11/winval.c $(HACK_H) ../include/winX.h $(TARGET_CC) $(TARGET_CFLAGS) $(X11CFLAGS) -c -o $@ ../win/X11/winval.c -$(TARGETPFX)tile.o: tile.c $(HACK_H) -$(TARGETPFX)winshim.o: ../win/shim/winshim.c $(HACK_H) - $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/shim/winshim.c -$(TARGETPFX)cppregex.o: ../sys/share/cppregex.cpp $(CONFIG_H) - $(TARGET_CXX) $(TARGET_CXXFLAGS) -c -o $@ ../sys/share/cppregex.cpp -$(TARGETPFX)qt_bind.o: ../win/Qt/qt_bind.cpp $(HACK_H) ../win/Qt/qt_pre.h \ - ../win/Qt/qt_post.h ../win/Qt/qt_bind.h ../win/Qt/qt_main.h \ - ../win/Qt/qt_kde0.h ../win/Qt/qt_click.h ../win/Qt/qt_delay.h \ - ../win/Qt/qt_xcmd.h ../win/Qt/qt_key.h ../win/Qt/qt_map.h \ - ../win/Qt/qt_win.h ../win/Qt/qt_clust.h ../win/Qt/qt_menu.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 \ - $(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 $(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 $(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 $(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 $(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_str.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 $(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 $(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 $(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 \ - qt_main.moc ../win/Qt/qt_bind.h ../win/Qt/qt_glyph.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 $(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 \ - $(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 $(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 $(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 \ - $(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 \ - $(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 \ - $(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 $(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 $(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 $(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 \ - $(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_main.h ../win/Qt/qt_kde0.h ../win/Qt/qt_click.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 $(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 $(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 $(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) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/chain/wc_chainout.c -$(TARGETPFX)wc_trace.o: ../win/chain/wc_trace.c $(HACK_H) ../include/wintty.h \ - ../include/func_tab.h +$(TARGETPFX)wc_trace.o: ../win/chain/wc_trace.c $(HACK_H) \ + ../include/func_tab.h ../include/wintty.h $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/chain/wc_trace.c +$(TARGETPFX)cursdial.o: ../win/curses/cursdial.c $(HACK_H) \ + ../include/func_tab.h ../include/wincurs.h \ + ../win/curses/cursdial.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursdial.c +$(TARGETPFX)cursinit.o: ../win/curses/cursinit.c $(HACK_H) \ + ../include/wincurs.h ../win/curses/cursinit.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursinit.c +$(TARGETPFX)cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) \ + ../include/wincurs.h ../win/curses/cursinvt.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursinvt.c +$(TARGETPFX)cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/wincurs.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmain.c +$(TARGETPFX)cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) \ + ../include/wincurs.h ../win/curses/cursmesg.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmesg.c +$(TARGETPFX)cursmisc.o: ../win/curses/cursmisc.c $(HACK_H) ../include/dlb.h \ + ../include/func_tab.h ../include/wincurs.h \ + ../win/curses/cursmisc.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursmisc.c +$(TARGETPFX)cursstat.o: ../win/curses/cursstat.c $(HACK_H) \ + ../include/wincurs.h ../win/curses/cursstat.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/cursstat.c +$(TARGETPFX)curswins.o: ../win/curses/curswins.c $(HACK_H) \ + ../include/wincurs.h ../win/curses/curswins.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/curses/curswins.c +$(TARGETPFX)winshim.o: ../win/shim/winshim.c $(HACK_H) + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/shim/winshim.c +$(TARGETPFX)getline.o: ../win/tty/getline.c $(HACK_H) ../include/func_tab.h \ + ../include/wintty.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/getline.c +$(TARGETPFX)termcap.o: ../win/tty/termcap.c $(HACK_H) ../include/tcap.h \ + ../include/wintty.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/termcap.c +$(TARGETPFX)topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h \ + ../include/wintty.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/topl.c +$(TARGETPFX)wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h \ + ../include/tcap.h ../include/wintty.h + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/tty/wintty.c $(TARGETPFX)allmain.o: allmain.c $(HACK_H) $(TARGETPFX)alloc.o: alloc.c $(CONFIG_H) ../include/nhlua.h $(TARGETPFX)apply.o: apply.c $(HACK_H) @@ -1088,6 +1112,7 @@ $(TARGETPFX)ball.o: ball.c $(HACK_H) $(TARGETPFX)bones.o: bones.c $(HACK_H) $(TARGETPFX)botl.o: botl.c $(HACK_H) $(TARGETPFX)cmd.o: cmd.c $(HACK_H) ../include/func_tab.h +$(TARGETPFX)coloratt.o: coloratt.c $(HACK_H) $(TARGETPFX)dbridge.o: dbridge.c $(HACK_H) $(TARGETPFX)decl.o: decl.c $(HACK_H) $(TARGETPFX)detect.o: detect.c $(HACK_H) ../include/artifact.h @@ -1101,9 +1126,9 @@ $(TARGETPFX)dog.o: dog.c $(HACK_H) $(TARGETPFX)dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h $(TARGETPFX)dokick.o: dokick.c $(HACK_H) $(TARGETPFX)dothrow.o: dothrow.c $(HACK_H) -$(TARGETPFX)drawing.o: drawing.c $(CONFIG_H) ../include/color.h \ - ../include/rm.h ../include/objclass.h ../include/defsym.h \ - ../include/objects.h ../include/wintype.h ../include/sym.h +$(TARGETPFX)drawing.o: drawing.c $(CONFIG_H) ../include/defsym.h \ + ../include/objclass.h ../include/objects.h ../include/rm.h \ + ../include/sym.h ../include/wintype.h $(TARGETPFX)dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h \ ../include/dlb.h $(TARGETPFX)eat.o: eat.c $(HACK_H) @@ -1112,8 +1137,8 @@ $(TARGETPFX)engrave.o: engrave.c $(HACK_H) $(TARGETPFX)exper.o: exper.c $(HACK_H) $(TARGETPFX)explode.o: explode.c $(HACK_H) $(TARGETPFX)extralev.o: extralev.c $(HACK_H) -$(TARGETPFX)files.o: files.c $(HACK_H) ../include/dlb.h ../include/wintty.h \ - #zlib.h +$(TARGETPFX)files.o: files.c #zlib.h $(HACK_H) ../include/dlb.h \ + ../include/wintty.h $(TARGETPFX)fountain.o: fountain.c $(HACK_H) $(TARGETPFX)hack.o: hack.c $(HACK_H) $(TARGETPFX)hacklib.o: hacklib.c $(HACK_H) @@ -1125,15 +1150,16 @@ $(TARGETPFX)lock.o: lock.c $(HACK_H) $(TARGETPFX)mail.o: mail.c $(HACK_H) ../include/mail.h $(TARGETPFX)makemon.o: makemon.c $(HACK_H) $(TARGETPFX)mcastu.o: mcastu.c $(HACK_H) -$(TARGETPFX)mdlib.o: mdlib.c $(CONFIG_H) ../include/permonst.h \ - ../include/monsters.h ../include/align.h ../include/monattk.h \ - ../include/monflag.h ../include/objclass.h \ - ../include/defsym.h ../include/objects.h ../include/wintype.h \ - ../include/sym.h ../include/artilist.h ../include/dungeon.h \ - ../include/sndprocs.h ../include/seffects.h ../include/obj.h \ - ../include/monst.h ../include/mextra.h ../include/you.h \ - ../include/attrib.h ../include/prop.h ../include/skills.h \ - ../include/context.h ../include/flag.h ../include/dlb.h +$(TARGETPFX)mdlib.o: mdlib.c $(CONFIG_H) ../include/align.h \ + ../include/artilist.h ../include/attrib.h \ + ../include/context.h ../include/defsym.h ../include/dlb.h \ + ../include/dungeon.h ../include/flag.h ../include/mextra.h \ + ../include/monattk.h ../include/monflag.h ../include/monst.h \ + ../include/monsters.h ../include/obj.h ../include/objclass.h \ + ../include/objects.h ../include/permonst.h ../include/prop.h \ + ../include/seffects.h ../include/skills.h \ + ../include/sndprocs.h ../include/sym.h ../include/wintype.h \ + ../include/you.h $(TARGETPFX)mhitm.o: mhitm.c $(HACK_H) ../include/artifact.h $(TARGETPFX)mhitu.o: mhitu.c $(HACK_H) ../include/artifact.h $(TARGETPFX)minion.o: minion.c $(HACK_H) @@ -1144,28 +1170,28 @@ $(TARGETPFX)mkobj.o: mkobj.c $(HACK_H) $(TARGETPFX)mkroom.o: mkroom.c $(HACK_H) $(TARGETPFX)mon.o: mon.c $(HACK_H) ../include/mfndpos.h $(TARGETPFX)mondata.o: mondata.c $(HACK_H) -$(TARGETPFX)monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h \ - ../include/artifact.h -$(TARGETPFX)monst.o: monst.c $(CONFIG_H) ../include/permonst.h \ - ../include/monsters.h ../include/align.h ../include/monattk.h \ - ../include/monflag.h ../include/wintype.h ../include/sym.h \ - ../include/defsym.h ../include/color.h +$(TARGETPFX)monmove.o: monmove.c $(HACK_H) ../include/artifact.h \ + ../include/mfndpos.h +$(TARGETPFX)monst.o: monst.c $(CONFIG_H) ../include/align.h \ + ../include/defsym.h ../include/monattk.h ../include/monflag.h \ + ../include/monsters.h ../include/permonst.h ../include/sym.h \ + ../include/wintype.h $(TARGETPFX)mplayer.o: mplayer.c $(HACK_H) $(TARGETPFX)mthrowu.o: mthrowu.c $(HACK_H) $(TARGETPFX)muse.o: muse.c $(HACK_H) $(TARGETPFX)music.o: music.c $(HACK_H) -$(TARGETPFX)nhlua.o: nhlua.c $(HACK_H) ../include/dlb.h -$(TARGETPFX)nhlsel.o: nhlsel.c $(HACK_H) ../include/sp_lev.h $(TARGETPFX)nhlobj.o: nhlobj.c $(HACK_H) ../include/sp_lev.h +$(TARGETPFX)nhlsel.o: nhlsel.c $(HACK_H) ../include/sp_lev.h +$(TARGETPFX)nhlua.o: nhlua.c $(HACK_H) ../include/dlb.h $(TARGETPFX)nhmd4.o: nhmd4.c $(HACK_H) ../include/nhmd4.h $(TARGETPFX)o_init.o: o_init.c $(HACK_H) -$(TARGETPFX)objects.o: objects.c $(CONFIG_H) ../include/obj.h \ - ../include/prop.h ../include/skills.h ../include/color.h \ - ../include/objclass.h ../include/defsym.h ../include/objects.h +$(TARGETPFX)objects.o: objects.c $(CONFIG_H) ../include/defsym.h \ + ../include/obj.h ../include/objclass.h ../include/objects.h \ + ../include/prop.h ../include/skills.h $(TARGETPFX)objnam.o: objnam.c $(HACK_H) -$(TARGETPFX)options.o: options.c $(CONFIG_H) ../include/objclass.h \ - ../include/defsym.h ../include/objects.h ../include/flag.h \ - $(HACK_H) ../include/tcap.h ../include/optlist.h +$(TARGETPFX)options.o: options.c $(CONFIG_H) $(HACK_H) ../include/defsym.h \ + ../include/flag.h ../include/objclass.h ../include/objects.h \ + ../include/optlist.h ../include/tcap.h $(TARGETPFX)pager.o: pager.c $(HACK_H) ../include/dlb.h $(TARGETPFX)pickup.o: pickup.c $(HACK_H) $(TARGETPFX)pline.o: pline.c $(HACK_H) @@ -1197,13 +1223,14 @@ $(TARGETPFX)steed.o: steed.c $(HACK_H) $(TARGETPFX)symbols.o: symbols.c $(HACK_H) ../include/tcap.h $(TARGETPFX)sys.o: sys.c $(HACK_H) $(TARGETPFX)teleport.o: teleport.c $(HACK_H) +$(TARGETPFX)tile.o: tile.c $(HACK_H) $(TARGETPFX)timeout.o: timeout.c $(HACK_H) $(TARGETPFX)topten.o: topten.c $(HACK_H) ../include/dlb.h $(TARGETPFX)track.o: track.c $(HACK_H) $(TARGETPFX)trap.o: trap.c $(HACK_H) $(TARGETPFX)u_init.o: u_init.c $(HACK_H) -$(TARGETPFX)utf8map.o: utf8map.c $(HACK_H) $(TARGETPFX)uhitm.o: uhitm.c $(HACK_H) +$(TARGETPFX)utf8map.o: utf8map.c $(HACK_H) $(TARGETPFX)vault.o: vault.c $(HACK_H) $(TARGETPFX)version.o: version.c $(HACK_H) ../include/dlb.h $(TARGETPFX)vision.o: vision.c $(HACK_H) @@ -1215,7 +1242,28 @@ $(TARGETPFX)wizard.o: wizard.c $(HACK_H) $(TARGETPFX)worm.o: worm.c $(HACK_H) $(TARGETPFX)worn.o: worn.c $(HACK_H) $(TARGETPFX)write.o: write.c $(HACK_H) -$(TARGETPFX)zap.o: zap.c $(HACK_H) +qt_kde0.moc: $(QTn_H) ../win/Qt/qt_kde0.h + $(MOCPATH) -o $@ $(QTn_H) +qt_main.moc: $(QTn_H) ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h + $(MOCPATH) -o $@ $(QTn_H) +qt_map.moc: $(QTn_H) ../win/Qt/qt_clust.h ../win/Qt/qt_map.h ../win/Qt/qt_win.h + $(MOCPATH) -o $@ $(QTn_H) +qt_menu.moc: $(QTn_H) ../win/Qt/qt_menu.h ../win/Qt/qt_rip.h ../win/Qt/qt_win.h + $(MOCPATH) -o $@ $(QTn_H) +qt_msg.moc: $(QTn_H) ../win/Qt/qt_msg.h ../win/Qt/qt_win.h + $(MOCPATH) -o $@ $(QTn_H) +qt_plsel.moc: $(QTn_H) ../win/Qt/qt_plsel.h + $(MOCPATH) -o $@ $(QTn_H) +qt_set.moc: $(QTn_H) ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h \ + ../win/Qt/qt_main.h ../win/Qt/qt_set.h + $(MOCPATH) -o $@ $(QTn_H) +qt_stat.moc: $(QTn_H) ../win/Qt/qt_icon.h ../win/Qt/qt_stat.h \ + ../win/Qt/qt_win.h + $(MOCPATH) -o $@ $(QTn_H) +qt_xcmd.moc: $(QTn_H) ../win/Qt/qt_xcmd.h + $(MOCPATH) -o $@ $(QTn_H) +qt_yndlg.moc: $(QTn_H) ../win/Qt/qt_yndlg.h + $(MOCPATH) -o $@ $(QTn_H) # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above diff --git a/sys/unix/hints/linux.370 b/sys/unix/hints/linux.370 index b32d26fc0..9f72c42af 100755 --- a/sys/unix/hints/linux.370 +++ b/sys/unix/hints/linux.370 @@ -43,6 +43,11 @@ endif GAMEUID = $(USER) GAMEGRP = games +# This gives better backtraces by making all core functions global; this +# works around a limitation in glibc's backtrace(3) function. +# Recommended with CRASHREPORT. +#NOSTATICCORE = 1 + #----------------------------------------------------------------------------- # You shouldn't need to change anything below here (in the hints file; if # you're reading this in Makefile augmented by hints, that may not be true). From a22ed4f232719bd809c33851cbde5b523632b20f Mon Sep 17 00:00:00 2001 From: nhkeni Date: Mon, 4 Mar 2024 13:38:17 -0500 Subject: [PATCH 3/3] depend.awk changes - sort the dependencies - sort the rules - the above can be disabled in the BEGIN block - usage documentation changes for next commit --- sys/unix/depend.awk | 90 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 3 deletions(-) diff --git a/sys/unix/depend.awk b/sys/unix/depend.awk index 89af26d8a..43fc1311e 100644 --- a/sys/unix/depend.awk +++ b/sys/unix/depend.awk @@ -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: 1697316508 2023/10/14 20:48:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.16 $ +# $NHDT-Date: 1709577497 2024/03/04 18:38:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.18 $ # # usage: # awk -f depend.awk ../include/*.h list-of-.c/.cpp-files @@ -9,6 +9,9 @@ # ( cd src ; make all ; cp ../sys/unix/Makefile.src ./Makefile ; \ # make depend ; cp ./Makefile ../sys/unix/Makefile.src ; \ # cd .. ; sh sys/unix/setup.sh [sys/unix/hints/FOO] ) +# newer usage: +# cd sys/unix ; make -f Makefile.src updatedepend + # # This awk program scans each file in sequence, looking for lines beginning # with `#include "' and recording the name inside the quotes. For .h files, @@ -31,6 +34,8 @@ # zlib.h ditto # BEGIN { FS = "\"" #for `#include "X"', $2 is X + dosort = 1 + dorulesort = 1 special[++sp_cnt] = "../include/config.h" special[++sp_cnt] = "../include/hack.h" alt_deps["../include/extern.h"] = "" @@ -73,7 +78,10 @@ FNR == 1 { output_dep() #finish previous file } deps[file] = deps[file] " " incl } -END { output_dep() } #finish the last file +END { + output_dep() #finish the last file + output_final() #write output + } # @@ -81,7 +89,29 @@ END { output_dep() } #finish the last file # 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( base, targ, moc) + +function output_dep(){ + if(dorulesort){ + worklist[++worklistctr] = file + } else { + output_final2() + } +} + +function output_final( x) +{ + if(dorulesort){ + nhsort(worklist, 1, worklistctr-1, 1) + for(x=1;x= (i < n ? 78 : 80) - 1) { printf(" \\\n\t\t"); col = 16 #make a backslash+newline split @@ -197,4 +230,55 @@ function depend(inout, name, skip, n, i, list) return inout } +# +# sort list[first]..list[last] +# Derived from: https://www.baeldung.com/linux/awk-begin-and-end-rules +# +function nhsort(list, first, last, cmpid, i,j,temp) +{ + for (i = first; i <= last-1; i++) { + for (j = i+1; j <= last; j++) { + if (nhcmp(list[i], list[j], cmpid)) { + temp = list[i] + list[i] = list[j] + list[j] = temp + } + } + } +} + +function nhcmp(a,b,cmpid) +{ +if(cmpid == 0){ # sort dependencies + # 2 .c or .cpp files + if (a ~ /\.c(pp)?$/ && b ~ /\.c(pp)?$/ ){ return a > b } + # a .c or .cpp file and anything else + if (a ~ /\.c(pp)?$/){ return 0 } + if (b ~ /\.c(pp)?$/){ return 1 } + # default + return a > b +} else if(cmpid == 1){ # sort rules + # 2 .h files + if (a ~ /\.h$/ && b ~ /\/.h$/){ return a > b } + # a .h and anything else + if (a ~ /\.h$/){ return 0 } + if (b ~ /\.h$/){ return 1 } + # 2 .c or .cpp files + if (a ~ /\.c(pp)?$/ && b ~ /\.c(pp)?$/ ){ return a > b } + # a .c or .cpp file and anything else + if (a ~ /\.c(pp)?$/){ return 0 } + if (b ~ /\.c(pp)?$/){ return 1 } + # 2 .moc files + if (a ~ /\.moc$/ && b ~ /\.moc$/){ return a > b } + # a .moc and anything else + if (a ~ /\.moc$/){ return 0 } + if (b ~ /\.moc$/){ return 1 } + # default + return a > b +} else { + print "internal error cmpid=" cmpid + exit 1 +} +} + #depend.awk#