Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: $(shell uname -r) Doesn't Work

  1. #1
    Join Date
    Oct 2008
    Beans
    14

    $(shell uname -r) Doesn't Work

    Hi,

    I'm trying to write my own driver with very little experience and am having some troubles at the start. I'm following a few tutorials and most of them include the line:
    Code:
    $(shell uname -r)
    in the Makefile.

    When trying to run this I get the message that the command shell doesn't exist and I should install byobu, I did that, but I don't think the command shell that comes with byobu is the correct one.

    Could someone help me out?

  2. #2
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    Try just $(uname -r)

  3. #3
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    Wait a minute....
    This is in the makefile?
    You are not supposed to run the makefile (as you would a bash script) make is supposed to use it, in which case I believe your original syntax is correct.

  4. #4
    Join Date
    Oct 2008
    Beans
    14

    Re: $(shell uname -r) Doesn't Work

    Thanks for the help, after some experimentation I just figured this out, but I can't explain whats going on.

    For example if I do $(shell uname -r) in bash it fails, if I do $(shell uname -r) in makefile its correct.

    If I do $(PWD) in bash it fails, if I do $(PWD) in makefile its correct.

    Whats going on here?

  5. #5
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    A makefile is not the same as bash script.
    Try a makefile tutorial

  6. #6
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    ... And here's a more "in depth" link that should answer all your questions about makefiles.

  7. #7
    Join Date
    Oct 2008
    Beans
    14

    Re: $(shell uname -r) Doesn't Work

    Thanks for the help.

    Do you happen to know of a good link for USB driver development in Ubuntu?

    Thought it was worth asking and thanks again for the quick responses.

  8. #8
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    Here's a link to some (oldish) links

    But what device are you trying to write a driver for?
    The chances are that it has already been done, or someone else is already working on it.

  9. #9
    Join Date
    Oct 2008
    Beans
    14

    Re: $(shell uname -r) Doesn't Work

    Its for a webcam.

    I have a strong urge to develop some software from the ground up. I am electrical engineer but spend time doing mostly high level matlab programming and am a little embarrassed that I don't know whats really involved in talking to hardware. I have a feeling I'm biting off a little too much starting at the webcam, but it was just laying around so it seemed like a good place to start.

  10. #10
    Join Date
    Jul 2006
    Location
    London, UK
    Beans
    818
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: $(shell uname -r) Doesn't Work

    Your webcam probably already has a suitable module written: You could take a look at the source code, or look at the source code for something like the gspca module which handles many cameras.

    If I were you though, I'd start with something very simple (write a c program to output some data to the serial, or USB port, or make the Caps Lock light blink).

    Good luck.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •