home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5613 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.8 KB  |  49 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!proforma!jgg
  3. From: jgg@proforma.com (J. G. Gregory)
  4. Subject: understanding make
  5. Message-ID: <1992Aug14.192253.2265@proforma.com>
  6. Keywords: make
  7. Sender: jgg@proforma.com
  8. Organization: Pro Forma
  9. Date: Fri, 14 Aug 1992 19:22:53 GMT
  10. Lines: 37
  11.  
  12. I am trying to debug a problem that occurs deep inside lex.  I want to turn on  
  13. the debugging features of lex, but I can't seem to get "make" to compile the  
  14. lex output with the debugging flags on.  I feel (and hope) that it is my weak  
  15. understanding of make that is the problem.
  16.  
  17. I want to put -DLEXDEBUG in when I cc the lex output.  That is, in the sequence  
  18. of commands involved in making an object file:
  19.  
  20. lex foo.lm
  21. mv lex.yy.c foo.m
  22. cc -g -Wall -DDEBUG    -c foo.m -o debug_obj/foo.o
  23.                     ^^^
  24. I want -DLEXDEBUG here^
  25.  
  26. foo.lm is in a subproject.  I have tried adding 
  27. OTHER_CFLAGS = -DLEXDEBUG
  28. to the Makefile.preamble in that subproject directory, but it doesn't have an  
  29. effect.  I also tried rewriting the suffix rule for .lm to .o, but that didn't  
  30. have an effect either.  Further, the default for .lm.o has a rm line which  
  31. never happens on my system:
  32. .lm.o:
  33.     $(LEX) $(LFLAGS) $*.lm
  34.     $(MV) $(MVFLAGS) lex.yy.c $*.m
  35.     $(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m
  36.     $(RM) $(RMFLAGS) $*.m
  37.  
  38. I think I must not be overriding something late enough.  I tried putting the  
  39. things in Makefile.postamble, but had the same lack of success.
  40.  
  41. I can do what I want manually, but frustration with make looms so large that I  
  42. feel I must ask for advice.  Nearly everything I have tried doesn't have the  
  43. intended effect.  The NeXT make hierarchy is complex and hard to follow.  I  
  44. have the Nutshell book on make, which is pretty weak, and no real help on  
  45. something as complex as NeXT's make stuff.
  46.  
  47. Any and all advice appreciated.
  48. --J Gregory
  49.