Compiling Nethack question

G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Trying to compile nethack using DJGPP under Dos, and have set up DJGPP
following the instructions on
http://www.delorie.com/djgpp/zip-picker.html

I believe I have followed the Dos nethack install instructions step by
step, and I receive this error when I try to run make...

gcc -c -o -i../include -ddlb -duse_tiles -oo/makedefs.o
.../util/makedefs.c
make.exe: *** [o/makedefs.o] Error -1

Does anyone have any idea what I might have done wrong or what file I
might be missing still?

--
~ Matthew M Poxson ~
54440 Rodrick-Cav-Dwa-Fem-Law died in The Dungeons of Doom on level
10. Killed by a forest centaur, while helpless. - [95]
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Philipp Lucas wrote:
> On Mon, 21 Mar 2005, Matt Poxson wrote:
>
> > Trying to compile nethack using DJGPP under Dos,
>
> Heh; even I have switched away from DJGPP to VC or cygwin...

DJGPP is still very useful for compiling a version of NetHack you can
compress and put on a single floppy disk. (The trick is to set the game
to automatically extract into a RAM drive.) You can play it on any PC
you can boot a floppy from, even if it lacks a working hard drive or
CD-ROM drive. Good thing to have around when your drive starts making
funny noises...
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

On Mon, 21 Mar 2005, Matt Poxson wrote:

> Trying to compile nethack using DJGPP under Dos,

Heh; even I have switched away from DJGPP to VC or cygwin...

> I believe I have followed the Dos nethack install instructions step by
> step, and I receive this error when I try to run make...
>
> gcc -c -o -i../include -ddlb -duse_tiles -oo/makedefs.o
> ../util/makedefs.c
> make.exe: *** [o/makedefs.o] Error -1
>
> Does anyone have any idea what I might have done wrong or what file I
> might be missing still?

If this is a verbatim copy of the command, there is something deeply
wrong with the arguments. They should read

gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o ../util/makedefs.c

(Note that some switches are lower case and some are upper case.)

Issue this command on its own and note whether gcc reports an error.


If this is not a verbatim copy, but typed by yourself: Maybe you have
mistakenly written the correct location of makedefs.c, but the command
actually said ../src/makedefs.c ? ISTR that this is known problem with the
DOS-GCC-Makefile: A "touch" command is issued to ../src/makedefs.c ,
creating an empty file, which is then used for compilation (which would
not create the error above).


Anyway, the output of the plain gcc command will be helpful.

--
Philipp Lucas
phlucas@online-club.de
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Philipp Lucas wrote:
> problem with the DOS-GCC-Makefile: A "touch" command is issued to
> ../src/makedefs.c , creating an empty file, which is then used for

Something about what you wrote clicked for me, and I relooked in the
install.dos file, and saw...
Also be sure to pick up djgpp v2gnu/fil41b.zip to get ls.exe and
touch.exe, since the Makefile uses them by default

And while I was very sure to download fil41b.zip, I have found that I
do not have touch.exe or ls.exe on my computer. For some reason
fil41b.zip did not contain either file. I'm going to try to find out
if I can find them now, but I have no idea of where to begin looking.
(As far as I know fil41b.zip had the two exe files just with different
names)

--
~ Matthew M Poxson ~
54440 Rodrick-Cav-Dwa-Fem-Law died in The Dungeons of Doom on level
10. Killed by a forest centaur, while helpless. - [95]
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Matt Poxson wrote:
> Philipp Lucas wrote:
>> problem with the DOS-GCC-Makefile: A "touch" command is issued to
>> ../src/makedefs.c , creating an empty file, which is then used for
>
> Something about what you wrote clicked for me, and I relooked in the
> install.dos file, and saw...
> Also be sure to pick up djgpp v2gnu/fil41b.zip to get ls.exe and
> touch.exe, since the Makefile uses them by default
>
> And while I was very sure to download fil41b.zip, I have found that
> I do not have touch.exe or ls.exe on my computer. For some reason
> fil41b.zip did not contain either file. I'm going to try to find out
> if I can find them now, but I have no idea of where to begin
> looking. (As far as I know fil41b.zip had the two exe files just
> with different names)

I believe I found them (that was quick), and tried to run it again and
again with no different result. Below is the exact things that I tried
and the output that was produced:

C:\cygwin\Nethack\nethack-3.4.3\src>make
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
.../util/makedefs.c
make.exe: *** [o/makedefs.o] Error -1

C:\cygwin\Nethack\NETHAC~1.3\src>make makefile
make.exe: Nothing to be done for `makefile'.

C:\cygwin\Nethack\NETHAC~1.3\src>make -f makefile
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
.../util/makedefs.c
make.exe: *** [o/makedefs.o] Error -1

C:\cygwin\Nethack\NETHAC~1.3\src>gcc
gcc.exe: no input files

C:\cygwin\Nethack\NETHAC~1.3\src>make -?
c:/djgpp/bin/make.exe: invalid option -- ?
Usage: make.exe [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing
anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging
information.
-e, --environment-overrides
Environment variables override
makefiles.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from commands.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with
no arg.
-k, --keep-going Keep going when some targets can't be
made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is
below N.
-n, --just-print, --dry-run, --recon
Don't actually run any commands; just
print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't
remake it.
-p, --print-data-base Print make's internal database.
-q, --question Run no commands; exit status says if up
to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo commands.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
-v, --version Print the version number of make and
exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on
implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is
referenced.

Report bugs to <bug-make@gnu.org>.

C:\cygwin\Nethack\NETHAC~1.3\src>make install
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
.../util/makedefs.c
make.exe: *** [o/makedefs.o] Error -1

C:\cygwin\Nethack\NETHAC~1.3\src>make -n -f makefile
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
.../util/makedefs.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/monst.o monst.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/objects.o objects.c
gcc -o../util/makedefs.exe o/makedefs.o o/monst.o o/objects.o
...\util\makedefs -v
...\util\makedefs -o
...\util\makedefs -p
...\util\makedefs -m
...\util\makedefs -z
chdir ..\util
bison -y -d lev_comp.y
copy y_tab.c lev_yacc.c
copy y_tab.h ..\include\lev_comp.h
del y_tab.c
del y_tab.h
chdir ..\src
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/lev_yacc.o
.../util/lev_yacc.c
chdir ..\util
bison -y -d lev_comp.y
copy y_tab.c lev_yacc.c
copy y_tab.h ..\include\lev_comp.h
del y_tab.c
del y_tab.h
chdir ..\src
chdir ..\util
flex lev_comp.l
if exist ..\util\lev_flex.c del ..\util\lev_flex.c
copy lexyy.c ..\util\lev_flex.c
del lexyy.c
chdir ..\src
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/lev_flex.o
.../util/lev_flex.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/lev_main.o
.../util/lev_main.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/alloc.o alloc.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/panic.o ../util/panic.c
gcc -c -O -I../include -DDLB -DUSE_TILES -I../sys/msdos -oo/drawing.o
drawing.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/decl.o decl.c
gcc -c -O -I../include -DDLB -DUSE_TILES -I../sys/msdos -DSTUBVIDEO -oo/stubvid.
o ../sys/msdos/video.c
gcc -o../util/lev_comp.exe o/lev_yacc.o o/lev_flex.o o/lev_main.o
o/alloc.o
o/monst.o o/objects.o o/panic.o o/drawing.o
o/decl.o
o/stubvid.o
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/dgn_yacc.o
.../sys/share/dgn_yacc.c
chdir ..\util
bison -y -d dgn_comp.y
copy y_tab.c dgn_yacc.c
copy y_tab.h ..\include\dgn_comp.h
del y_tab.c
del y_tab.h
chdir ..\src
chdir ..\util
flex dgn_comp.l
if exist ..\util\dgn_flex.c del ..\util\dgn_flex.c
copy lexyy.c ..\util\dgn_flex.c
del lexyy.c
chdir ..\src
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/dgn_flex.o
.../util/dgn_flex.c
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/dgn_main.o
.../util/dgn_main.c
gcc -o../util/dgn_comp.exe o/dgn_yacc.o o/dgn_flex.o o/dgn_main.o
o/alloc.o
o/panic.o
gcc -c -O -I../include -DDLB -DUSE_TILES -I../win/share -I../sys/msdos
-oo/tilem
ap.o ../win/share/tilemap.c
gcc -o../util/tilemap.exe o/tilemap.o
...\util\tilemap.exe
echo A new ../src/tile.c has been created
make.exe: *** No rule to make target `tile.c', needed by `o/tile.o'.
Stop.

C:\cygwin\Nethack\NETHAC~1.3\src>

So this tells me that something is going wrong with tile.c, but I have
no idea what.
--
~ Matthew M Poxson ~
54440 Rodrick-Cav-Dwa-Fem-Law died in The Dungeons of Doom on level
10. Killed by a forest centaur, while helpless. - [95]
 

Chuck

Distinguished
Nov 19, 2001
1,479
0
19,280
Archived from groups: rec.games.roguelike.nethack (More info?)

"Matt Poxson" <poxsonm@comcast.net> wrote in news:HbqdnRxkJ9Rkt6LfRVn-
hQ@comcast.com:

> Matt Poxson wrote:
>> Philipp Lucas wrote:
>>> problem with the DOS-GCC-Makefile: A "touch" command is issued to
>>> ../src/makedefs.c , creating an empty file, which is then used for
>>
>> Something about what you wrote clicked for me, and I relooked in the
>> install.dos file, and saw...
>> Also be sure to pick up djgpp v2gnu/fil41b.zip to get ls.exe and
>> touch.exe, since the Makefile uses them by default
>>
>> And while I was very sure to download fil41b.zip, I have found that
>> I do not have touch.exe or ls.exe on my computer. For some reason
>> fil41b.zip did not contain either file. I'm going to try to find out
>> if I can find them now, but I have no idea of where to begin
>> looking. (As far as I know fil41b.zip had the two exe files just
>> with different names)
>
> I believe I found them (that was quick), and tried to run it again and
> again with no different result. Below is the exact things that I tried
> and the output that was produced:
>
> C:\cygwin\Nethack\nethack-3.4.3\src>make
> gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
> ../util/makedefs.c
> make.exe: *** [o/makedefs.o] Error -1
>
> C:\cygwin\Nethack\NETHAC~1.3\src>make makefile
> make.exe: Nothing to be done for `makefile'.
>
> C:\cygwin\Nethack\NETHAC~1.3\src>make -f makefile
> gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
> ../util/makedefs.c
> make.exe: *** [o/makedefs.o] Error -1

At this point I see that you are not very familiar with make or gcc, Didyou
check in the readme WHAT packages are needed to compile nethack. If not DO SO
and TRIPLE check that with what zips you downloaded. Other than that try
detaring the archive to a DIFFerent directory. You did follow the install
file right about the setup configuration BEFORE compiling?
> make.exe: *** No rule to make target `tile.c', needed by `o/tile.o'.
> Stop.
>
> C:\cygwin\Nethack\NETHAC~1.3\src>
>
> So this tells me that something is going wrong with tile.c, but I have
> no idea what.



--
lisp LIVES!!!
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

"Matt Poxson" <poxsonm@comcast.net> wrote:

>Below is the exact things that I tried
>and the output that was produced:
>
>C:\cygwin\Nethack\nethack-3.4.3\src>make
>gcc -c -O -I../include -DDLB -DUSE_TILES -oo/makedefs.o
>../util/makedefs.c
>make.exe: *** [o/makedefs.o] Error -1

I just created a DJGPP binary, but I could not reproduce your problems.

It seems that your setup of NetHack or the setup of GCC is in error. To
check whether it is gcc, run the plain command "gcc" on a file with the
following contents:

int main(int a, char** aa){
return a;
}

This should generate a file a.exe which does nothing obvious.


Furthermore, please give the output of the complete gcc command the
Makefile tries to execute, with an additional -v:

gcc -v -c -O -I../include -DDLB -DUSE_TILES
-oo/makedefs.o ../util/makedefs.c

(One line.)

>C:\cygwin\Nethack\NETHAC~1.3\src>make -n -f makefile
>bison -y -d lev_comp.y

If you do not have bison and flex (which is most likely, and you do not
need them at the moment anyway), set YACC_LEX = N in Makefile:68.

>echo A new ../src/tile.c has been created
>make.exe: *** No rule to make target `tile.c', needed by `o/tile.o'.
>Stop.
>
>So this tells me that something is going wrong with tile.c, but I have
>no idea what.

It seems that at this point make does not recognise that
.../src/tile.c=tile.c. But if everything runs smoothly up to this point,
the file will have been created. (If in doubt, replace tile.c in
Makefile:1079 by $(SRC)/tile.c .)


--
Philipp Lucas
phlucas@online-club.de