Question: This is the LINUX question 1. Three students are working on the same project, and each of them contributes a C file with the name

This is the LINUX question

1. Three students are working on the same project, and each of them contributes a C file with the name foo*.c (foo1.c, foo2.c, foo3.c). The main function is included in the file prod.c, which uses functions defined in all the foo*.c files. The goal here is to build an object for each of the foo*.c files, with the name obtained by replacing the extension c by o, and to build the final executable called prod.out. Write a simple Makefile such that one just need to type make in the terminal to build the objects and the executable.

Here are sample examples.

This is the LINUX question 1. Three students are working on the

same project, and each of them contributes a C file with the

compile gcc -c filel.c lib: gcc -c file2.c mv file2.o libfile2.a link: gcc filel.o -L. -lfile2 clean: make compile make lib make link ./a.out make clean link: 1ib compile gcc filel.c -L. -lfile2 lib: gcc -c file2.c mv file2.o libfile2.a compile: gcc -c filel.c clean: make . /a.out make clean

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!