mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Zhu <mylinuxk@yahoo.ca>
To: linux-kernel@vger.kernel.org
Subject: Get major number in Makefile
Date: Tue, 2 Apr 2002 10:42:00 -0500 (EST)	[thread overview]
Message-ID: <20020402154200.30415.qmail@web14912.mail.yahoo.com> (raw)

Hi, smart gurus, I have a question while writing a
Makefile file to install my device driver. In my
device driver I dynamically allocate the major number
of my device. In my Makefile I want to build a device
node for my device under the /dev directory.

   mknod /dev/mydevice c $major 0;

So I need to know the major number of my deivce in the
Makefile. I've read the Linux 'Device Driver'. There
is some information about this. I use the following
command to get the major number in my Makefile.

major=`awk "\\$2==\"$mymodule\" {printf \\$1}"
/proc/devices`

But when I use the 'make install' command to install
my driver, the following error returned.

major=`awk "\\==\"$ymodule\" {printf \\}"
/proc/devices`
awk: 0: unexpected character '\'
awk: line 1: syntax error at or near ==
make: *** [install] Error 2

What is wrong with my command? Can anyone tell me how
to get the major number in Makefile.

Thank you very much.


______________________________________________________________________ 
Find, Connect, Date! http://personals.yahoo.ca

             reply	other threads:[~2002-04-02 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-02 15:42 Michael Zhu [this message]
2002-04-02 15:54 ` Richard B. Johnson
2002-04-02 18:30 Jesse Pollard

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=20020402154200.30415.qmail@web14912.mail.yahoo.com \
    --to=mylinuxk@yahoo.ca \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®