help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: urgent help on Makefile


From: Yin Lei
Subject: Re: urgent help on Makefile
Date: Mon, 7 May 2001 12:27:47 -0700 (PDT)

Hi, Paul:

Thank you very much for your kindly help. :)

You're right, so now let's focus on my final goal: How to build mutiple
targets.

Maybe I didn't describe my goal clearly. My goal is:
Suppose there is a build tree like:
        |-> module/
        |-> bin/
        |-> lib/
root----|-> include/
        |-> src -----> dirA/
                |----> dirB/
                ...
                |----> dirN/

in module directory, there are some files named as "mods.*", in which are
directory names which contains source codes for current project.
in each "dir*", there is a file named "file" which contains file name of
current directory used for building target.

So my question is: if someone want to add a new exectuable target in
current system, what he need to do is just create a new "mods.xxx" in
module directory and give me the directory names in this file, Meanwhile,
he should also add "xxx" into module list of my main Makefile.

Based on your recommendation, I still have some questions:
If I wrote some sub-makefile such as: "proj1.mk, proj2.mk, ..."
the contents of them are:

proj1.mk
--------
SRC     = foo1.c bar1.c baz1.c
proj1:  $(SRCS:.c=.o)

proj2.mk
--------
SRC     = foo2.c bar2.c baz2.c
proj2:  $(SRC:.c=.o)

...

And the main Makefile as:

MODULE_LIST = proj1 proj2 proj3 ...
include $(MODULE_LIST:%=%.mk)

$(MODULE_LIST):
        <do whatever to build a module>

what make me confuse is: if there is any confliction because the variable
name of each "*.mk" are same?

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lei Yin, Ph.D
Celestry Design Technologies, Inc
1982A Zanker Road, San Jose, CA 95112
Tel: (408)501-2313(O) | Fax: (408)501-2607
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"I'd change the world but God won't give me the source code" -- Anonymous





reply via email to

[Prev in Thread] Current Thread [Next in Thread]