home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3837 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!sun-barr!decwrl!mips!munnari.oz.au!bunyip.cc.uq.oz.au!brolga!drt
  3. From: drt@brolga.cc.uq.oz.au (David Taylor)
  4. Subject: Re: MAKE Question - am I asking too much?
  5. Message-ID: <drt.711759988@brolga>
  6. Keywords: MAKE HELP 
  7. Sender: news@bunyip.cc.uq.oz.au (USENET News System)
  8. Organization: Prentice Centre, University of Queensland
  9. References: <drt.711704826@brolga> <Brr54t.DzE@scd.hp.com>
  10. Date: Tue, 21 Jul 1992 23:06:28 GMT
  11. Lines: 35
  12.  
  13.  
  14. mun@corp.hp.com (Duane T. Mun) writes:
  15.  
  16. >> - checkout any files that are needed to satisfy the make.
  17. >$(HDRS) $(SRCS):    # Check out sources and headers as needed
  18. >    co $@
  19. Thank you for this one...works well.
  20.  
  21. >> - pre-compile the C/SQL files.
  22. >> - compile the C files
  23. >test.o: dclgen.h    # set up dependancies
  24. Shouldn't this also be dependant on test.c (or test.sc) ?
  25.  
  26. >.c.o:            # how to make .o from .c
  27. >    $(CC) $(CFLAGS) -c $< $(INCDIRS)
  28. >
  29. >.sc.o:             # how to make .o from .sc
  30. >    $(CPP) -C -P $< > $*.cpp    # get dclgen stuff
  31. >    $(ESQLC) $*.cpp
  32. >    $(CC) $(CFLAGS) -c $*.c $(INCDIRS)
  33. >    rm -f $*.cpp $*.c
  34. I have almost exactly this but it fails under one circumstance:
  35. - If the .c file is still around from the last compile, it will not
  36.   prep the .sc. This happens if the $(CC) fails because it will then
  37.   miss the rm -f $*.c. It is a pain to remove these by hand every time
  38.   the compile fails.
  39.  
  40. I'm not sure why it does this, but it looks to me like it hits the 
  41. .c.o target instead of the .sc.o target. I think I'm wrong here
  42. because swapping there order in the makefile makes no difference.
  43. I have a suspicion that the problem lies with the program targets.
  44.  
  45. Any more ideas?
  46. --
  47. D.T
  48.