ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I am new to linux and right now I am just following a tutorial.
I have these two files EchoClient.c and EchoServer.c and a Makefile.txt for them.Now I want to know what command do I have to execute from the shell so as to create the output of the makefile.Please let me know.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
First off, a Makefile is named "Makefile," not "Makefile.anything;" that'll cause you problems.
So,
Code:
prompt: mv Makefile.txt Makefile
prompt: make
You can, actually, name a Makefile anything you want to (although that will get confusing after a while) and execute the make utility
Code:
make -f WhatEverNameYouGaveIt
and that will work but you probably see where this is going, eh? The make utility "looks for" a file named "Makefile" by default, probably a good idea to simply follow that.
First off, a Makefile is named "Makefile," not "Makefile.anything;" that'll cause you problems.
So,
Code:
prompt: mv Makefile.txt Makefile
prompt: make
You can, actually, name a Makefile anything you want to (although that will get confusing after a while) and execute the make utility
Code:
make -f WhatEverNameYouGaveIt
and that will work but you probably see where this is going, eh? The make utility "looks for" a file named "Makefile" by default, probably a good idea to simply follow that.
Hope this helps some.
Hi Tronayne,
I am getting the following error when I executed the command you specified....
Quote:
make: *** No rule to make target `EchoServer.c', needed by `EchoServer'. Stop.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Your C source files, EchoClient.c and EchoServer.c, what are they? That is, are they both main program source files? Is one a main and the other a function?
If they are both main files, a Makefile would look something like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.