Can't Execute Makefile, Even As Root!
6,330
First off:
- Don't compile things as
root
, it is totally unnecessary. It may be needed for the finalmake install
, but most likely not otherwise. - Don't compile things in
/usr/bin
, that's where (base system) utilities are installed.
Instead:
- Compile things as "you" (ordinary user).
- Compile things somewhere in your home directory, for example in a temporary
~/build
directory under which you have unpacked the sources.
The Makefile is not an executable. It is a file containing instructions for the make
program for how to build a particular piece of software.
You use the Makefile by simply typing make
.
If the software came with any installation instructions (look for an INSTALL
file), read them.
Related videos on Youtube
Author by
GremlinsBane
Updated on September 18, 2022Comments
-
GremlinsBane over 1 year
I'm trying to compile a
c
program, but when I try to execute themakefile
, I get "Permission denied".This is what I did :
root@mycpu:/usr/bin# MakeFile -bash: /usr/bin/MakeFile: Permission denied root@mycpu:/usr/bin#
-
smw about 7 yearsMakefiles are usually executed explicitly with
make
e.g.make -f MakeFile
or justmake
if you have named the file suitably (it will look for amakefile
orMakefile
in the current directory by default). -
Dmitry Grigoryev about 7 yearsThis question looks like one of those nightmares which don't make any sense but are scary as hell.
-
radrow over 3 yearsI don't get why this question is downvoted
-
-
GremlinsBane about 7 yearsMan, I feel stupid. Thank you for your help!
-
Kusalananda about 7 years@GremlinsBane The stupider you feel, the less likely it is that you will be in the same situation again. Also, I have definitely done things like this! :-)
-
GremlinsBane about 7 yearsThat's encouraging!
-
JdeBP about 7 yearsA common Debian trick is for a
debian/rules
file to be an executable makefile, with#!/usr/bin/make -sf
as its interpreter. But at beginner level, yes, makefiles are not directly executable.