From: Manish Katiyar <mkatiyar@gmail.com>
To: Toan Pham <tpham3783@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Dynamic make target
Date: Wed, 2 Dec 2009 23:50:43 +0530 [thread overview]
Message-ID: <ea11fea30912021020tc720492i498d316482500ab9@mail.gmail.com> (raw)
In-Reply-To: <ffb2c0280912020949i3db06e02i118df36e13aaaf41@mail.gmail.com>
On Wed, Dec 2, 2009 at 11:19 PM, Toan Pham <tpham3783@gmail.com> wrote:
> hi all,
>
> I do not know where to ask this question perhaps this mailing list is
> best because it had to do with c complilation.
>
> I would like to set up a make target dynamicly. for example
>
> when one issue command: make sda1
> it auto compile and install to a mount point @ /mnt/sda1
>
> similiarly: make sda2 would compile and install to /mnt/sda2
>
>
> i know that in a makefile one can accomplish this by setting up two targets, ie.
>
> sda1:
> make all
> mount /dev/sda1 /mnt/sda1
> cp releases/* /mnt/sda1
> umount /mnt/sda1
>
> sda2:
> make all
> mount /dev/sda1 /mnt/sda2
> cp releases/* /mnt/sda2
> umount /mnt/sda2
>
>
> i am curious if we can simplify everything by having a make target
> like this when no matches found
Will something like this help ?
/tmp/test> make
echo "Making defaults"
Making defaults
/tmp/test> make TARGET=manish
echo manish is target;
manish is target
/tmp/test> cat Makefile
ifeq ("$(origin TARGET)", "command line")
$(TARGET):
echo $@ is target;
else
all:
echo "Making defaults"
endif
>
> $param1:
> make all
> mount /dev/sda1 /mnt/$param1
> cp releases/* /mnt/$param1
> umount /mnt/$param1
>
> thank you,
>
> Toan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-02 18:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 17:49 Dynamic make target Toan Pham
2009-12-02 18:20 ` Manish Katiyar [this message]
2009-12-03 5:30 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea11fea30912021020tc720492i498d316482500ab9@mail.gmail.com \
--to=mkatiyar@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=tpham3783@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).