Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# specify the object files . . . OBJ = main.o functions.o # specify the compiler CC = gcc # this is the cross platform
# specify the object files
OBJ main.o functions.o
# specify the compiler
CC gcc # this is the cross platform standard C compiler
CXX g # this is the GNU C compiler
#CXX CC # Solaris C compiler
# specify the compiler options
CFLAGS g
# specify the target C files
TARGETSRC main.c functions.c
# specify variables
EXENAME demo
# leads comments in a line
# Build all: default target
all: $EXENAME
# Separate compilation to build object files
main.o: main.c functions.h
$CCc $CFLAGS main.c
function.o: functions.c functions.h
$CCc $CFLAGS functions.c
# linking
#demo is a target which depends upon main.o and functions.o
#gcc main.o functions.o o demo" is the command to produce the executable file
#You need to use a TAB before gcc
$EXENAME: $OBJ
$CC $OBJo $EXENAME
# Testing
check: all
$EXENAME
# Debugging with gdb
g: all
gdb $EXENAME
# Valgrind
valgrind:
valgrind leakcheckfull showleakkindsall $EXENAME
# Clean up all build targets so that one may get a clean build
clean:
rm f o $EXENAMEcore
fix the valgrind issue in this make file
Step 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