Question
Modify the below program dealer.c so that the program is split into three source files and two header files. A) Put all functions related to
Modify the below program dealer.c so that the program is split into three source files and two header files.
A) Put all functions related to operations on the list of cars into car.c.
B) Create a header file named car.h that contains struct car declaration and prototypes for the functions in car.c. The header file should enclose the contents of the header file in an #ifndef-#endif pair to protect the file.
C) Put the read_line function in a separate file named readline.c.
D) Create a header file named readline.h that contains a prototype for the read_line function. The header file should enclose the contents of the header file in an #ifndef-#endif pair to protect the file.
E) dealer.c contains the main function.
F) Include appropriate header files in the source files.
2.) Write a makefile to build the program on student cluster. The makefile should contain the following rules:
A) Build readline.o by compiling readline.c.
B) Build car.o by compiling car.c.
C) Build dealer.o by compiling dealer.c
D) Build dealer by linking readline.o, car.o, and dealer.o
Each rule should include the name of the target file, dependencies among files, and the command to be executed. The makefile should name the executable file for the program
dealer.
7 8 9 10 #includeStep 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