Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-19-2004, 10:33 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 8

Rep: Reputation: 0
stupid makefile question

i dont know why this is doing this. i have a makefile setup to run...

compiler = /usr/bin/g++

compilerflags = -ansi -Wall

OBJECTS = driver.o

driver: driver.o
$(compiler) $(compilerflags) -o driver driver.o

driver.o: driver.c /usr/include/driver.h
$(compiler) $(compilerflags) -c driver.c

it compiles and i get driver as the executable.

but how do i run it? it's been a while for me and i get

bash: driver: command not found when i type in driver

any ideas?
Old 10-19-2004, 10:57 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
./driver . (the current directory) usually isn't in your $PATH, so you have to specify it explicitly.
Old 10-19-2004, 11:12 PM   #3
LQ Newbie
Registered: Oct 2004
Posts: 8

Original Poster
Rep: Reputation: 0
im not sure what you mean...
Old 10-19-2004, 11:35 PM   #4
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
How about the command: make driver
Old 10-19-2004, 11:41 PM   #5
LQ Newbie
Registered: Oct 2004
Posts: 8

Original Poster
Rep: Reputation: 0
that gives me the same thing, i already have the target as driver
Old 10-19-2004, 11:46 PM   #6
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
What btmiller means is that instead of typing
you should use
because in Linux by default executables are
only picked when they can be found in the
directories that the path variable points at
echo $PATH
for a test ... alternatively, you can use a
qualified filename to run it, e.g.
or a shorthand that contains a reference to
a directory, e.g.
or, as suggested above,

For more detail have a look at the output of
ls -la
in a not too full directory... at the top of the listing
you'll see something like
[tink@diggn:/tmp]$ ls -la
total 959961
drwxrwxrwt  39 root     root       2424 2004-10-20 16:23 .
drwxr-xr-x  20 root     root        504 2004-10-14 10:38 ..
drwxrwxrwt   2 root     root        168 2004-10-20 16:23 .ICE-unix
-r--r--r--   1 root     root         11 2004-10-20 16:22 .X0-lock
drwxrwxrwt   2 root     root         72 2004-10-20 16:22 .X11-unix
Note the top two entries in the listing. They refer
to the current directory (.) and the parent directory (..)


Last edited by Tinkster; 09-08-2005 at 03:19 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
makefile question ashwin.tanugula Programming 2 10-26-2005 04:08 PM
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 10:12 PM
Question about makefile taureanyang Programming 1 03-26-2005 12:57 AM
makefile question blackzone Programming 2 12-20-2004 08:03 AM
Stupid Dumb Stupid Question... drigz Linux - Software 3 09-23-2004 04:09 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration