linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toan Pham <tpham3783@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Dynamic make target
Date: Wed, 2 Dec 2009 12:49:35 -0500	[thread overview]
Message-ID: <ffb2c0280912020949i3db06e02i118df36e13aaaf41@mail.gmail.com> (raw)

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

$param1:
       make all
       mount /dev/sda1 /mnt/$param1
       cp releases/* /mnt/$param1
       umount /mnt/$param1

thank you,

Toan

             reply	other threads:[~2009-12-02 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 17:49 Toan Pham [this message]
2009-12-02 18:20 ` Dynamic make target Manish Katiyar
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=ffb2c0280912020949i3db06e02i118df36e13aaaf41@mail.gmail.com \
    --to=tpham3783@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /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).