Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
File hello.h
#include <stdio.h>
File main.c
#include "hello.h"
main()
{
printhello();
credits();
}
File print.c
#include "hello.h"
void printhello()
{
printf ("Hello world!\n");
}
File credits.c
#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
- Relevant commands, code, scripts, algorithms:
make make clean ls
- The attempts at a solution (include all code and scripts):
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$
- 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).