Sponsored Content
Full Discussion: Using the Make command
Homework and Emergencies Homework & Coursework Questions Using the Make command Post 302563309 by lilbo4231 on Tuesday 11th of October 2011 01:01:39 AM
Old 10-11-2011
Using the Make command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

File hello.h

Code:
#include <stdio.h>

File main.c

Code:
#include "hello.h"
 
main()
{
    printhello();
    credits();
}

File print.c

Code:
#include "hello.h"
 
void printhello()
{
    printf ("Hello world!\n");
}

File credits.c

Code:
#include "hello.h"
 
void credits()
{
    printf ("\n(This ridiculous example of overkill was created for CptS 224.)\n");
}

(6 points) Write a Makefile that will correctly compile subparts "main.o", "print.o", "credits.o" and both "make helloworld" command and "make" commmand will assemble a program called "helloworld" from those parts. The dependencies should be correct so that if any of the 4 files is updated, the correct pieces will get rebuilt.
(1 point) Your Makefile should be written so that "make clean" command will remove program "helloworld", "*.o" and any other executables which were created.


those are the two i need help with the most. It doesnt seem like i am doing it correctly

2. Relevant commands, code, scripts, algorithms:

make make clean ls


3. The attempts at a solution (include all code and scripts):
Code:
9:58pm
aaron@aaron-VirtualBox:~/Desktop$ cc -c hello.h

aaron@aaron-VirtualBox:~/Desktop$ cc -c main.c

aaron@aaron-VirtualBox:~/Desktop$ cc -c print.c

aaron@aaron-VirtualBox:~/Desktop$ cc -c credits.c

aaron@aaron-VirtualBox:~/Desktop$ cc hello.h main.o print.o credits.o -o helloworld

aaron@aaron-VirtualBox:~/Desktop$ ./helloworld

Hello world!



(This ridiculous example of overkill was created for CptS 224.)

aaron@aaron-VirtualBox:~/Desktop$



4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

Washington State University, Washington, US, Bakken, CS224 CptS 224: Homework 3 - Make

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

Last edited by pludi; 10-11-2011 at 03:50 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

make command

Dear Guys , Kindly note that i have sun solaries 8 intel machine . i installed apache and it is working fine . i am installing perl5 , MD5 and CGI . but whenever i execute the commands , make , make test and make install i get error message : not found # make make: not found also i... (2 Replies)
Discussion started by: tamemi
2 Replies

2. UNIX for Dummies Questions & Answers

make command

hi i tried to search for the "make" command but to no avail. this is what happens: when i try to type the "make" command, it prompt me the error " csh:make:not found ***error code 1 make:Fatal error: command fail for target 'all' " i have just freshly install solaris 9 on my server.... (8 Replies)
Discussion started by: legato
8 Replies

3. Solaris

C compiler and make command

Hey Guys.... I installed Solaris 10 (10/08) on _X86 platform, I need install any software of load balance. I find the pen-0.18.0-sol10-x86-local software. I cant finish the install process , i dont find the make command, I think this command is associated to the C compiler process. But... (2 Replies)
Discussion started by: aggadtech08
2 Replies

4. Solaris

make command failure

Hi After downloading and compiling new ntp source for Solaris 10 I used the make command on the ntp directory. I received the following output: bash-3.00# make (bk version) >/dev/null 2>&1 && \ cd . && \ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version... (2 Replies)
Discussion started by: shaife720
2 Replies

5. UNIX for Advanced & Expert Users

problem with make command

hi guys would u clarify me how to use make command , how to write rules of make command and to execute . (1 Reply)
Discussion started by: chinakampalli p
1 Replies

6. Solaris

make command problem

hi, I'was trying to compile a simple game , just for testing the system, but the make command gave me problems, so I read that it was best to have a gnu make package installed so I made pkgrm SUNWgmake and installed the gnu make from sunfreesoftware, the problem is that now when I run make... (9 Replies)
Discussion started by: freeware
9 Replies

7. Solaris

how to make all of this in one command

dears what i need to make is cp -irp file_name filename tar cvf filename.tar filename gzip filename.tar in one commane using exec it that prossible and how can i do that (4 Replies)
Discussion started by: xxmasrawy
4 Replies

8. Homework & Coursework Questions

Utilizing the Make Command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Compile cpp2html.c to produce cpp2html.o. ( Important: the source code in these files is C, not C++, and so... (8 Replies)
Discussion started by: lamentofking
8 Replies

9. Homework & Coursework Questions

Utilizing the Make Command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: ]Compile cpp2html.c to produce cpp2html.o. ( Important: the source code in these files is C, not C++, and so... (1 Reply)
Discussion started by: bgnaranjo1
1 Replies

10. UNIX for Beginners Questions & Answers

How to make df command?

in RHEL 6.10, how can we make the the df -k return the output without wrapping. And wihout using the df -Pk option. After we patched a Linux server from 6.5 to 6.10: The df -k on RHAT 6.10 it wraps the line for ex: 6.10: /dev/mapper/vgapp01-vendor ... (2 Replies)
Discussion started by: mrn6430
2 Replies
All times are GMT -4. The time now is 03:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy