Question: Modify Makefile2 using two features. Feature 1) Uses pattern matching rules that it generates .o files using the pattern matching rule below: %.o : %.c
Modify Makefile2 using two features. Feature 1) Uses pattern matching rules that it generates .o files using the pattern matching rule below:
%.o : %.c $(CC) -c $(CFLAGS) $
Feature 2) List the objects in the variable OBJECTS in the prerequisites or runProgram

Moba lextEditor File Edit Search View Format Encoding Syntax Special Tools XER -g -Wall Makefile2 1 CFLAGS 2 CC gcc 3 4 all: runProgram longProgram 5 6 # define OBJECTS here by listing all .o file needed in prereq. of runProgram 7 8 9 10 # checks time stamps on all pre-requisites and check if it needs 11 # recompilation 12 # use the variable OBJECT here instead of the .c files. 13 # see link from webpage on how that work. 14 runProgram: runProgram.c statistics.c getInput.c statistics.h 15 $(CC) $(CFLAGS) statistics.c getInput.c runProgram.c -o runProgram 16 17 18 # below add the .o to .c rule 19 # 20 21 longProgram: longProgram.c 22 $(CC) $(CFLAGS) $@.c -o $@ 23 24 clean: 25 rm -f runProgram 26 rm -f longProgram rm -f *.0 28 rm -rf runProgram. dSYM 29 rm -rf longProgram.dSYM 27 30
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
