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.
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 cleanStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started