🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1145

understanding make

#1145
From: J. G. Gregory
Date: Fri, 14 Aug 1992 19:22
37 lines
1899 bytes
I am trying to debug a problem that occurs deep inside lex.  I want to turn on  
the debugging features of lex, but I can't seem to get "make" to compile the  
lex output with the debugging flags on.  I feel (and hope) that it is my weak  
understanding of make that is the problem.

I want to put -DLEXDEBUG in when I cc the lex output.  That is, in the sequence  
of commands involved in making an object file:

lex foo.lm
mv lex.yy.c foo.m
cc -g -Wall -DDEBUG    -c foo.m -o debug_obj/foo.o
                    ^^^
I want -DLEXDEBUG here^

foo.lm is in a subproject.  I have tried adding 
OTHER_CFLAGS = -DLEXDEBUG
to the Makefile.preamble in that subproject directory, but it doesn't have an  
effect.  I also tried rewriting the suffix rule for .lm to .o, but that didn't  
have an effect either.  Further, the default for .lm.o has a rm line which  
never happens on my system:
.lm.o:
	$(LEX) $(LFLAGS) $*.lm
	$(MV) $(MVFLAGS) lex.yy.c $*.m
	$(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m
	$(RM) $(RMFLAGS) $*.m

I think I must not be overriding something late enough.  I tried putting the  
things in Makefile.postamble, but had the same lack of success.

I can do what I want manually, but frustration with make looms so large that I  
feel I must ask for advice.  Nearly everything I have tried doesn't have the  
intended effect.  The NeXT make hierarchy is complex and hard to follow.  I  
have the Nutshell book on make, which is pretty weak, and no real help on  
something as complex as NeXT's make stuff.

Any and all advice appreciated.
--J Gregory
Technical Details
Message-ID: <1992Aug14.192253.2265@proforma.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!proforma!jgg

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!proforma!jgg
From: jgg@proforma.com (J. G. Gregory)
Subject: understanding make
Message-ID: <1992Aug14.192253.2265@proforma.com>
Keywords: make
Sender: jgg@proforma.com
Organization: Pro Forma
Date: Fri, 14 Aug 1992 19:22:53 GMT
Lines: 37