home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10689 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.3 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!unidoct!plato!pape
  2. From: pape@plato.chemietechnik.uni-dortmund.de (David Pape)
  3. Newsgroups: comp.unix.questions
  4. Subject: makefile with multiple dirs
  5. Keywords: make,makefile
  6. Message-ID: <897@unidoct.chemietechnik.uni-dortmund.de>
  7. Date: 3 Sep 92 13:59:02 GMT
  8. Sender: news@unidoct.chemietechnik.uni-dortmund.de
  9. Lines: 36
  10.  
  11.  
  12.         Heres my (highly simplified) project directory setup:
  13.  
  14. proto:  makefile, resultant executable
  15.  
  16. proto/x:        x.c, x.h, x.o
  17. proto/y:        y.c, y.h, y.o
  18.  
  19. How can I run "make" in the "proto" dir, and have it put "x.o" and
  20. "y.o" in the correct directories? I also want to be able to run
  21. "makedepend" from the makefile in "proto" so that it creates the
  22. dependencies correctly, i.e:
  23.  
  24. # DO NOT DELETE THIS LINE -- make depend depends on it.
  25.  
  26. proto/x/x.o: proto/x/x.h
  27. proto/y/y.o: proto/y/y.h
  28.  
  29. Even when I have
  30. ---------------------------------
  31. X_PATH = proto/x
  32.  
  33. depend:
  34.         makedepend $(X_PATH)/x.c
  35. ---------------------------------
  36. in my makefile, I always get
  37.  
  38. x.o: proto/x/x.h        #notice missing path
  39.  
  40. Any helpful hints out there??
  41.  
  42. --
  43. David Pape                 | "Justice is inci- |            ///
  44. pape@plato.Chemietechnik.Uni-Dortmund.DE |  dental to law    |     \\\ UNI_DO
  45. Dortmund, Germany             |  and order"       |      \\\///
  46. tel: 49 231 7552682             | - J. Edgar Hoover |       \\//
  47.