Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the Makefile1 so that all files generates a .o file. Have a separate target for each .o file, retain the $(CFLAGS) variable and just

Modify the Makefile1 so that all files generates a .o file. Have a separate target for each .o file, retain the $(CFLAGS) variable and just add the -c flag to generate a .o file. Test it out:

image text in transcribed

MobaTextEditor File Edit Search View Format Encoding Syntax Special Tools X = Makefile1 1 CFLAGS -g-Wall 2 CC gcc 3 4 all: runProgram longProgram 5 6 7 8 # 9 # checks time stamps of all pre-requisites and check if it needs 10 # recompilation min N 000 11 # 12 # Modfy the prereqs which are currently .c files to .o files. 13 # Move the .h prereq to the prerque of the target statistics.o 14 # 15 # Note to complile .c files to a .o file you need the -c flag 16 # 17 # 18 # # https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html 19 # 20 # 21 # 22 runProgram: runProgram.c getInput.c statistics.c statistics.h $(CC) $(CFLAGS) statistics.c getInput.c runProgram.c -o runProgram 23 24 25 26 # add .o file targets here, one for each .c file 27 # 28 29 30 31 longProgram: longProgram.c 32 $(CC) $(CFLAGS) $@.C -0 $@ 33 34 clean: 35 rm -f runProgram 36 rm -f longProgram 37 rm -f *.0 38 rm -rf runProgram. dSYM 39 rm -rf longProgram.dSYM 40 41

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

Students also viewed these Databases questions

Question

6. The cost of the training creates a need to show that it works.

Answered: 1 week ago