Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patches & Hearse, makefile woes

1 view
Skip to first unread message

Michael Lehotay

unread,
Mar 25, 2003, 7:31:32 PM3/25/03
to
I applied the paranoid_quit, travel cache, sticky objects, and
preadjust patches and built a DOS binary. Will my bones be compatible
with the vanilla DOS 3.4.0/3.4.1 bones on Hearse?

I had some troubles with the djgpp makefile. The first time I did a
'make intall' the linker complained about monstr.o and vis_tab.o being
missing but the second time they got built without a hitch. I tried
this with freshly unpacked source code and got the same thing. I have
a working executable, but just thought I should mention that it didn't
go seamlessly. Also, YACC_LEX=Y doesn't seem to work for me. The
prebuilt code is used anyway.

Darshan Shaligram

unread,
Mar 26, 2003, 1:14:28 AM3/26/03
to
mleh...@hotmail.com (Michael Lehotay) writes:

> I applied the paranoid_quit, travel cache, sticky objects, and
> preadjust patches and built a DOS binary. Will my bones be compatible
> with the vanilla DOS 3.4.0/3.4.1 bones on Hearse?

They should be, assuming you compiled with the default options. (I'm not
sure about sticky objects and preadjust, but they sound safe enough.)

You'll know whether they're compatible when you try to upload them,
anyway. :-)

[...]


> Also, YACC_LEX=Y doesn't seem to work for me. The prebuilt code is
> used anyway.

Er, you do have flex and bison?

--
Darshan Shaligram dars...@aztec.soft.net

Michael Lehotay

unread,
Mar 26, 2003, 10:39:25 AM3/26/03
to
Darshan Shaligram <dars...@aztec.soft.net> wrote in message news:<n0jips...@aztec.soft.net>...

> mleh...@hotmail.com (Michael Lehotay) writes:
> > Also, YACC_LEX=Y doesn't seem to work for me. The prebuilt code is
> > used anyway.
>
> Er, you do have flex and bison?

Yes I do. The problem is with the makefile, I think. A closer look at
it shows that in several places conditions such as
ifeq "$(DO_YACC)" "YACC_ACT"
are checked before invoking bison and flex, but neither DO_YACC nor
the corresponding DO_LEX are defined anywhere.

I could, in theory, fix this makefile so it works but it would take me
a long time. I figured there must be somebody out there who is more
familiar with it and could spot the problem right away.

I feel like a bit of a whiner complaining about first the win32 port
and now this, but has nobody else experienced this?

Darshan Shaligram

unread,
Mar 26, 2003, 12:37:47 PM3/26/03
to
mleh...@hotmail.com (Michael Lehotay) writes:
> Darshan Shaligram <dars...@aztec.soft.net> wrote in message news:<n0jips...@aztec.soft.net>...
> > mleh...@hotmail.com (Michael Lehotay) writes:
> > > Also, YACC_LEX=Y doesn't seem to work for me. The prebuilt code is
> > > used anyway.

> > Er, you do have flex and bison?

> Yes I do. The problem is with the makefile, I think.

Indeed. I just took a look at it, and the DOS gcc makefile seems a
perfect maze of horror in the lex and yacc sections. I had to kick it in
several different places to make it behave.

> A closer look at it shows that in several places conditions such as
> ifeq "$(DO_YACC)" "YACC_ACT"
> are checked before invoking bison and flex, but neither DO_YACC nor
> the corresponding DO_LEX are defined anywhere.

Yes, and that's not the only problem.

Here's a diff you can apply to fix your makefile (you'll need to run
'setup gcc' in sys/msdos/ again after patching the makefile).

---------cut
diff -u -r1.1.1.1 Makefile.GCC
--- sys/msdos/Makefile.GCC 24 Feb 2003 16:06:20 -0000 1.1.1.1
+++ sys/msdos/Makefile.GCC 26 Mar 2003 17:06:22 -0000
@@ -67,6 +67,10 @@
# If you have yacc/lex or a work-alike set YACC_LEX to Y
#
YACC_LEX = Y
+ifeq ($(YACC_LEX),Y)
+DO_YACC = YACC_ACT
+DO_LEX = LEX_ACT
+endif

# If YACC_LEX is Y above, set the following to values appropriate for
# your tools.
@@ -608,15 +612,15 @@

ifeq "$(DO_YACC)" "YACC_ACT"

-$(INCL)/lev_comp.h: lev_yacc.c
+$(INCL)/lev_comp.h: $(U)lev_yacc.c

$(U)lev_yacc.c $(INCL)/lev_comp.h : $(U)lev_comp.y
- @$(subst /,\,chdir $(U)) & \
- @$(subst /,\,$(YACC) -d lev_comp.y) & \
- @$(subst /,\,copy $(YTABC) lev_yacc.c) & \
- @$(subst /,\,copy $(YTABH) $(INCL)/lev_comp.h) & \
- @$(subst /,\,@del $(YTABC)) & \
- @$(subst /,\,@del $(YTABH)) & \
+ @$(subst /,\,chdir $(UTIL))
+ @$(subst /,\,$(YACC) -d lev_comp.y)
+ @$(subst /,\,copy $(YTABC) lev_yacc.c)
+ @$(subst /,\,copy $(YTABH) $(INCL)/lev_comp.h)
+ @$(subst /,\,@del $(YTABC))
+ @$(subst /,\,@del $(YTABH))
@$(subst /,\,chdir $(SRC))
else

@@ -638,10 +642,11 @@

$(U)lev_$(LEX).c: $(U)lev_comp.l
ifeq "$(DO_LEX)" "LEX_ACT"
- @$(subst /,\,chdir $(U)) & \
- @$(subst /,\,$(LEX) $(FLEXSKEL) lev_comp.l) & \
- @$(subst /,\,copy $(LEXYYC) $@) & \
- @$(subst /,\,@del $(LEXYYC)) & \
+ @$(subst /,\,chdir $(UTIL))
+ @$(subst /,\,$(LEX) $(FLEXSKEL) lev_comp.l)
+ @$(subst /,\,if exist $@ del $@)
+ @$(subst /,\,copy $(LEXYYC) $@)
+ @$(subst /,\,del $(LEXYYC))
@$(subst /,\,chdir $(SRC))
else
@echo ---
@@ -660,12 +665,12 @@

ifeq "$(DO_YACC)" "YACC_ACT"
$(U)dgn_yacc.c $(INCL)/dgn_comp.h : $(U)dgn_comp.y
- @$(subst /,\,chdir $(U)) & \
- @$(subst /,\,$(YACC) -d dgn_comp.y) & \
- @$(subst /,\,copy $(YTABC) dgn_yacc.c) & \
- @$(subst /,\,copy $(YTABH) $(INCL)/dgn_comp.h) & \
- @$(subst /,\,@del $(YTABC)) & \
- @$(subst /,\,@del $(YTABH)) & \
+ @$(subst /,\,chdir $(UTIL))
+ @$(subst /,\,$(YACC) -d dgn_comp.y)
+ @$(subst /,\,copy $(YTABC) dgn_yacc.c)
+ @$(subst /,\,copy $(YTABH) $(INCL)/dgn_comp.h)
+ @$(subst /,\,@del $(YTABC))
+ @$(subst /,\,@del $(YTABH))
@$(subst /,\,chdir $(SRC))
else
$(U)dgn_yacc.c: $(SSHR)/dgn_yacc.c
@@ -687,10 +692,11 @@
ifeq "$(DO_LEX)" "LEX_ACT"

$(U)dgn_$(LEX).c: $(U)dgn_comp.l $(INCL)/dgn_comp.h
- @$(subst /,\,chdir $(U)) & \
- @$(subst /,\,$(LEX) $(FLEXSKEL) dgn_comp.l) & \
- @$(subst /,\,copy $(LEXYYC) $@) & \
- @$(subst /,\,@del $(LEXYYC)) & \
+ @$(subst /,\,chdir $(UTIL))
+ @$(subst /,\,$(LEX) $(FLEXSKEL) dgn_comp.l)
+ @$(subst /,\,if exist $@ del $@)
+ @$(subst /,\,copy $(LEXYYC) $@)
+ @$(subst /,\,del $(LEXYYC))
@$(subst /,\,chdir $(SRC))
else

---------cut

--
Darshan Shaligram dars...@aztec.soft.net

Michael Lehotay

unread,
Mar 26, 2003, 4:45:55 PM3/26/03
to
Darshan Shaligram <dars...@aztec.soft.net> wrote in message news:<ptoevx...@aztec.soft.net>...

> Here's a diff you can apply to fix your makefile (you'll need to run
> 'setup gcc' in sys/msdos/ again after patching the makefile).

Wow. That's great. Thank you very much Darshan.

There's still the problem of monstr.o and vis_tab.o not being built on
the first make, but it's not such a big deal because all I have to do
is run make again.

C:\proj\nethack\src>make o/monstr.o
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 -m

C:\proj\nethack\src>make o/monstr.o
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/monstr.o ../src/monstr.c

C:\proj\nethack\src>make o/monstr.o
make.exe: `o/monstr.o' is up to date.

Darshan Shaligram

unread,
Mar 27, 2003, 3:03:04 AM3/27/03
to
mleh...@hotmail.com (Michael Lehotay) writes:

[DOS gcc make]


> There's still the problem of monstr.o and vis_tab.o not being built on
> the first make

I can't seem to replicate that problem here.

> C:\proj\nethack\src>make o/monstr.o
> 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 -m

For me, make also performs the next step and runs


gcc -c -O -I../include -DDLB -DUSE_TILES -oo/monstr.o ../src/monstr.c

You could try make -d o/monstr.o and see if the output gives a clue to
what went wrong. (Not that I think it'll help much; make spits out
oodles of intimidating messages with -d, but it hasn't actually helped
me solve any makefile problems yet.)

--
Darshan Shaligram dars...@aztec.soft.net

Chi

unread,
Mar 28, 2003, 1:51:38 PM3/28/03
to
Darshan Shaligram <dars...@aztec.soft.net> wrote:
> mleh...@hotmail.com (Michael Lehotay) writes:
> [DOS gcc make]
>> There's still the problem of monstr.o and vis_tab.o not being built
>> on the first make
>
> I can't seem to replicate that problem here.

...whereas I have been having exactly the same problem here (albeit
tring to get makefile.GCC of the Slashem integration of 3.4.1 working).
It seems that, for me, the makefile is failing to even try building
those two object files (when explicitly built, they compile without
error) and then shouts loudly when it can't find them at the end.

gcc -oslashem.exe @o/slashem.lnk -lpc -lemu -lalleg
gcc.exe: o/monstr.o: No such file or directory (ENOENT)
gcc.exe: o/vis_tab.o: No such file or directory (ENOENT)
make.exe: *** [../binary/slashem.exe] Error 1

My temporary kludge was to explicitly add a gcc compile instruction in
the dependancy section (line 1130 and 1131) to make the files in
question.

$(O)monstr.o: monstr.c $(CONFIG_H)
$(CC) $(cflags) -o$@ monstr.c
$(O)vis_tab.o: vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h
$(CC) $(cflags) -o$@ vis_tab.c

- and then the problem is solved. Strange that it works out of the tin
for some people yet not others (sadly my brain has melted from trying
to get the integration done, so I've not a clue what is really causing
the problem - I bet it is something really simple :-).

Regards,

Chris.

Michael Lehotay

unread,
Mar 28, 2003, 3:12:54 PM3/28/03
to
On Fri, 28 Mar 2003, Chi wrote:
> Darshan Shaligram <dars...@aztec.soft.net> wrote:
> > mleh...@hotmail.com (Michael Lehotay) writes:
> > [DOS gcc make]
> >> There's still the problem of monstr.o and vis_tab.o not being built
> >> on the first make
> >
> > I can't seem to replicate that problem here.
>
> ...whereas I have been having exactly the same problem here

> gcc -oslashem.exe @o/slashem.lnk -lpc -lemu -lalleg


> gcc.exe: o/monstr.o: No such file or directory (ENOENT)
> gcc.exe: o/vis_tab.o: No such file or directory (ENOENT)
> make.exe: *** [../binary/slashem.exe] Error 1

I get that too. At this point, monstr.c and vis_tab.c have been created
but for some reason the %.o:%.c rule is not working. The -d option says
that make thinks the object files are up to date (I think). Maybe is has
something to do with the fact that these c files are intermediate. That's
all I can think of. If I have the time this weekend I will put on my
pointy hat and try to figure it out.

> Strange that it works out of the tin for some people yet not others

I am using GNU Make version 3.79.1 (for DJGPP)

Michael Lehotay

unread,
Mar 29, 2003, 9:00:07 AM3/29/03
to
I don't know why it works, but it does (at least for me). Here are the
changes I made to Makefile.GCC to get monstr.o and vis_tab.o to build
properly.

------cut here----------------
diff -r -u nethack-3.4.1/sys/msdos/Makefile.GCC patched/sys/msdos/Makefile.GCC
--- nethack-3.4.1/sys/msdos/Makefile.GCC Sun Feb 23 09:43:36 2003
+++ patched/sys/msdos/Makefile.GCC Sat Mar 29 08:33:42 2003
@@ -396,7 +396,7 @@
util: $(O)utility.tag

$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \
- $(INCL)/pm.h monstr.c vis_tab.c \
+ $(INCL)/pm.h $(SRC)/monstr.c $(SRC)/vis_tab.c \
$(U)lev_comp.exe $(U)dgn_comp.exe $(TILEUTIL)
$(subst /,\,echo utilities made > $@)

@@ -562,13 +562,13 @@
$(INCL)/pm.h: $(U)makedefs.exe
-$(subst /,\,$(U)makedefs -p)

-monstr.c: $(U)makedefs.exe
+$(SRC)/monstr.c: $(U)makedefs.exe
-$(subst /,\,$(U)makedefs -m)

$(INCL)/vis_tab.h: $(U)makedefs.exe
-$(subst /,\,$(U)makedefs -z)

-vis_tab.c: $(U)makedefs.exe
+$(SRC)/vis_tab.c: $(U)makedefs.exe
-$(subst /,\,$(U)makedefs -z)

#==========================================
@@ -1127,8 +1127,8 @@
$(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qt_clust.cpp
$(O)qttableview.o: ../win/Qt/qttableview.cpp $(INCL)/qttableview.h
$(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qttableview.cpp
-$(O)monstr.o: monstr.c $(CONFIG_H)
-$(O)vis_tab.o: vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h
+$(O)monstr.o: $(SRC)/monstr.c $(CONFIG_H)
+$(O)vis_tab.o: $(SRC)/vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h
$(O)allmain.o: allmain.c $(HACK_H)
$(O)alloc.o: alloc.c $(CONFIG_H)
$(O)apply.o: apply.c $(HACK_H) $(INCL)/edog.h

0 new messages