home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!unidoct!plato!pape
- From: pape@plato.chemietechnik.uni-dortmund.de (David Pape)
- Newsgroups: comp.unix.questions
- Subject: makefile with multiple dirs
- Keywords: make,makefile
- Message-ID: <897@unidoct.chemietechnik.uni-dortmund.de>
- Date: 3 Sep 92 13:59:02 GMT
- Sender: news@unidoct.chemietechnik.uni-dortmund.de
- Lines: 36
-
-
- Heres my (highly simplified) project directory setup:
-
- proto: makefile, resultant executable
-
- proto/x: x.c, x.h, x.o
- proto/y: y.c, y.h, y.o
-
- How can I run "make" in the "proto" dir, and have it put "x.o" and
- "y.o" in the correct directories? I also want to be able to run
- "makedepend" from the makefile in "proto" so that it creates the
- dependencies correctly, i.e:
-
- # DO NOT DELETE THIS LINE -- make depend depends on it.
-
- proto/x/x.o: proto/x/x.h
- proto/y/y.o: proto/y/y.h
-
- Even when I have
- ---------------------------------
- X_PATH = proto/x
-
- depend:
- makedepend $(X_PATH)/x.c
- ---------------------------------
- in my makefile, I always get
-
- x.o: proto/x/x.h #notice missing path
-
- Any helpful hints out there??
-
- --
- David Pape | "Justice is inci- | ///
- pape@plato.Chemietechnik.Uni-Dortmund.DE | dental to law | \\\ UNI_DO
- Dortmund, Germany | and order" | \\\///
- tel: 49 231 7552682 | - J. Edgar Hoover | \\//
-