[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Makefile
From: |
Rolf Magnus |
Subject: |
Re: Makefile |
Date: |
Sun, 29 Aug 2004 16:59:50 +0200 |
newbiecpp wrote:
> I am very sorry to post this one because I know it is out of topic but
> I cannot find the proper news group.
What about gnu.utils.help?
> I understand that most senior C++ programmers know makefile very well.
> My question is GNU makefile support command line argument?
>
> I want to write a makefile so that when you invoke "make test", the
> makefile will compile test like this:
>
> $project = "command line argument, i.e., test";
>
> $project : ($project).cpp
> g++ -ggdb -o $project ($project).cpp
>
> I cannot figure it out how I can get $project=test, the test is from
> command line argument.
If you add a command line argument like "test", make will try to find a
target with that name and build it. So to do the above, you'd need to
create a wildcard target that does the right thing. Your above example
is even be built-in to gnu make. Just try the following Makefile:
CXX = g++
CXXFLAGS = -ggdb
On a "make test", it should just do what you asked for above.
> I appreciate any help or direct me to the right new groups.
Done. (xpost & f'up to gnu.utils.help)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Makefile,
Rolf Magnus <=