Linux make no target

No targets specified and no makefile found. Stop. Makefile ubuntu

make looks for a file called makefile or Makefile in the current working directory. If it does not find one, it says:

No targets specified and no makefile found. 

You can specific a file with -f , although it actually sounds like you have no idea what you are doing, so maybe you should ask for more specific details.

There is no file called Makefile in your current directory. Either switch to the correct directory or specify the differently named makefile by passing the -f parameter to make , e.g. make -f MyMakefile .

It is a very bad idea to build stuff (i.e., run make ) as root. Do your building as a regular user, and only install as root.

If the previous went well, then you do

But as goldilocks says, you’d better ask with specifics: What package is this? Is it available already for your distribution? If yes, what is wrong with that one? (No, «I saw a message on saying the version of my distribution is insecure. » doesn’t cut it; if your distribution is managed halfways competently, they will have patched the problem already.) If not, perhaps they have their reasons not to include it. Is the functionality avaliable in some other way?

If you aren’t experienced, and don’t know what you are doing, you are in no position to asess the risks, and recover from any mishap. Installing random pieces of software on your system might destroy it.

Источник

«No target» error using Make

Are those spaces or a tab in front of the pandoc command. Make is notoriously picky about those being a tab and not spaces.

@slm: it’s a tab. I read somewhere that Windows’ EOL are not compatible, so I converted to whole file to Unix compatible EOL.

2 Answers 2

Problem:

You problem is that make doesn’t know about your targets.

You can run your above Makefile with make stackoverflow.markdown for example and it will work.

make only, however, will fail, since you only specified how to create your targets, but not which.

As leiaz point’s out the above pattern rule is called an implicit rule.

Makefile:

SRC = $(wildcard *.html) TAR = $(SRC:.html=.markdown) .PHONY: all clean all: $(TAR) %.markdown: %.html pandoc -o $< $@ clean: rm -f $(TAR) 

Explanation:

SRC get's all source files (those ending in .html ) via Makefile's wildcard .

Читайте также:  Primary partition and logical partition in linux

TAR substitutes each source file listed in SRC with a target ending with .markdown instead of .html .

.PHONY lists non-physical targets that are always out-of-date and are therefore always executed - these are often all and clean .

The target all has as dependency (files listed on the right side of the : ) all *.markdown files. This means all these targets are executed.

This snippet says: Each target ending with .markdown is depended on a file with the same name, except that the dependency is ending with .html . The wildcard % is to be seen as a * like in shell. The % on the right side, however, is compared to the match on the left side. Source.

Note that the whitespace sequence infront of pandoc is a TAB , since make defines that as a standard.

Finally, the phony clean target depicts how to clean your system from the files you've created with this Makefile. In this case, it's deleting all targets (those files that were named *.markdown .

Источник

make: No targets. Stop

make is working strangely on my Makefile. It gives error "No targets. Stop". When I write make clean, it writes: "No rule to make target clean." If i compile each file separately everything is fine. Below is the code:

CC = g++ CFLAGS = -g -Wall BOOSTIP = -I path/to/boost default: abc all: abc abc: main.o node.o network.o my_funs.o my_random.o $(CC) $(CFLAGS) $(BOOSTIP) main.o node.o network.o my_funs.o my_random.o -o abc main.o: main.cpp node.hpp network.hpp $(CC) $(CFLAGS) $(BOOSTIP) main.cpp -o main.o node.o: node.cpp node.hpp my_funs.hpp my_random.hpp $(CC) $(CFLAGS) $(BOOSTIP) node.cpp -o node.o network.o: network.cpp network.hpp node.hpp my_funs.hpp my_random.hpp $(CC) $(CFLAGS) $(BOOSTIP) network.cpp -o network.o my_funs.o: my_funs.cpp my_funs.hpp node.hpp my_random.hpp $(CC) $(CFLAGS) $(BOOSTIP) my_funs.cpp -o my_funs.o my_random.o: my_random.cpp my_random.hpp $(CC) $(CFLAGS) $(BOOSTIP) my_random.cpp -o my_random.o clean: rm abc *.o *~ 

I don't get that error when running your makefile. I had to change the spaces at the beginning of each line to tabs (which I suspect you have as well and they just didn't copy right in here). I get "No rule to make target main.cpp" which should be fine if I put main.cpp in my directory. you do not need "default: abc" as make will by default run the first target so all and default are the same thing.

@Flexo I respectfully disagree with deleting my post. In fact, my answer was exactly correct. This question is precisely answered by following the route I gave. If it were "just look it up", it would be unappropriate. But, I gave precise instructions to find the exact answer. Repeating the section from that link is pointless. For example, the contents there could change. But to point the read er to it, is exactly right.

@MarkGaleck: I agree with Flexo, and I find your comment baffling. You think that quoting the manual is pointless because the manual might be revised later, but that directions to the manual that rely on current Google ranks are better?? And anyway, that part of the manual doesn't really explain how to fix the problem; I already knew what the error message meant, and yet I don't know why Piotr Górski is getting it.

Читайте также:  Linux block size in bytes

Thank you all for your help. I managed to correct the error. It was a problem of Windows/Unix line ending. I had only CR, as it should be LF. @Beta: I managed to write the simple makefile and it worked correctly and that's why I thought about possible differences and checked the invisible signs. Thanks for idea!

Источник

Error when installing Makefile: "make: *** No targets specified and no makefile found. Stop."

I looked inside the folder-xf86-video-intel-2.17.0 and there is a file named "Makefile.in" it supposed to be a in file, right?

6 Answers 6

That happens because there is no file named Makefile in that directory. To create that Makefile, you need to execute

The configure script determines if your system has all the dependencies necessary to compile the application. If a dependency is not found, the configure will fail and the Makefile's will not be created. To solve that, you must install all the dependencies needed by the application.

The application xf86-video-intel seems to be provided by the xserver-xorg-video-intel package, and its dependencies may be easily installed by running

$ sudo apt-get build-dep xserver-xorg-video-intel 

For more information, you might want to read the README or INSTALL files.

should i install also new kernal? don't i have already the kernal i need with normal updaet? I heve now the 3.0.0-15 version. intellinuxgraphics.org/2011Q4.html install it like every makefile?

Just remember that in order for the ./configure file to run you made need a compiler. So do something like sudo apt-get install gcc . then run ./configure again and should work

Took me quite some time to realize Makefile is the file type, without a file extension. Useful comment.

The make command looks for a file called "Makefile", no extension, not "Makefile.in". Since the file is not found, make does not know what to do, and stops. (The error message is cryptic because in some rare cases, make can guess what to do without an actual Makefile.)

Read the instructions on how to compile your program. It's likely that you are required to run ./configure , first. This script will create "Makefile" based on your setup and "Makefile.in".

You can temporarily disable the Hebrew locale when looking for help online, just run

This will give you English messages.

More precisely, autoreconf generated Makefile.in from Makefile.am and configure creates Makefile from it.

should i install also new kernal? don't i have already the kernal i need with normal updaet? I heve now the 3.0.0-15 version. intellinuxgraphics.org/2011Q4.html install it like every makefile?

Читайте также:  Rtl8192cu kali linux driver

Dont worry.. There are only some packages need to be intalled.. type "sudo synaptic" in terminal and enter.. in search box type "qt4-qmake" and mark for installation. then same as above search" libqt4-dev" and "libxml2-dev" and do the same mark for installation simultaneously.. then apply without check the download option. here it is. Then go to cd netanim directory and type "make clean" and enter, if it does not work type "qmake NetAnim.pro" and enter, it takes couple of seconds. then type "make" and enter. Here its done, it will take less then a minute. Now in netanim directory type "./NetAnim" and enter.

Here you will see animation interface. Good luck

make sure you have installed this file or

sudo apt install libc6-dev 

Now, you need to configure the installation file

./configure make && make install 

Источник

make: *** No targets. Stop while building linux kernel module [closed]

I am just trying to learn how to driver modules for Linux Kernel. I followed Linux Device drivers 3rd edition book and started my work. I created a sample program and makefile. Please find my makefile contents below.

obj-m += testModule.o make -C /lib/modules/3.2.36/build M=$(PWD) modules 

So, that two-line block is your Makefile? Try putting a line that says all: or my_program: or foo: (the : is critical) immediately before the line that says make -C /lib/modules/3.2.36/build M=$(PWD) modules , and make sure that that line (the make -C . line) is indented by a tab.

I tried! It worked!! Thank you so much Scott. Since it is my first linux dirver, I did silly mistakes. I apologize. Thank you so much for your help.

There is another problem in the makefile. The make inside the makefile is going on recursion it is not picking my linux source tree makefile.

@Rengasami: D’oh! I missed that. Recursion in Makefile s is not necessarily bad, but you’re probably better off avoiding it. // @Benji: I disagree. It could have been asked on Stack Overflow or Super User, but it’s in scope for Unix and Linux.

1 Answer 1

That make -C command should be separated,

obj-m += testModule.o default: make -C /lib/modules/`uname -r`/build SUBDIRS=$(PWD) modules 

Hot Network Questions

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533

Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Оцените статью
Adblock
detector