Question: # 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
