Skip to content
Extraits de code Groupes Projets
Valider cfe9e735 rédigé par Giovanna Stefanelli's avatar Giovanna Stefanelli
Parcourir les fichiers

Update Makefile.c

parent 9a4aaa53
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #6177 en échec
# Group: Q6 - gs
# Date: 23 April 2020
# Group: Q6
# Date: 26 April 2020
# Course: LEPL1503 - PROJECT3
# Object: factorial
# Object: factorial programme with Cunit test, Valgrind and cppcheck modules
CC = gcc
# The option -Werror convert warning into error
FLAGS = -Werror -pthread
#TEST_FLAGS = -I${HOME/local/include} -L${HOME/local/lib -Wall -lcunit
#TEST_FLAGS = -I${HOME}/local/include} -L${HOME}/local/lib -Wall -lcunit
fact: fact.c
$(CC) $(FLAGS) fact.c -o fact -lm
echo Compiler task ended
echo "fact.c file compiled"
# File provinding wrong numbers (negative, <2, 0), command:
# ./fact incorrect_numbers.txt out.txt
test: Fact_UnitTest.c
gcc -Wall -lcunit -I${HOME}/local/include Fact_UnitTest.c -L${HOME}/local/lib -o Fact_UnitTest -lm
echo "Test completed"
$(CC) -Wall -I${HOME}/local/include Fact_UnitTest.c -L${HOME}/local/lib -o Fact_UnitTest -lcunit -lm
echo "Fact_UnitTest.c file compiled"
clean: fact
clean:
rm fact
# rm testing ouput files ####
rm Fact_UnitTest
rm out*.txt
echo "Clean completed"
# rm Fact_UnitTest
# rm out*.txt
## ADDITIONAL MAKE COMMANDS:
## make cunit, make valgrind, make cppcheck, make valgrind_cunit, make cppcheck_cunit
valgrind:
valgrind ./fact
cunit:
# Before the execution launch:
export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
# The output of the unit test is stored in "Cunit_test_file.txt"
./Fact_UnitTest > Cunit_test_file.txt 2>&1
echo "Unit test launched see report in test_file.txt"
valgrind_test:
valgrind ./Fact_UnitTest
valgrind:
valgrind ./fact > valgrind_fact.txt 2>&1
cppcheck:
cppcheck ./fact
cppcheck ./fact > cppcheck_fact.txt 2>&1
valgrind_cunit:
valgrind ./Fact_UnitTest > valgrind_cunit.txt 2>&1
cppcheck_test:
cppcheck ./Fact_UnitTest
\ No newline at end of file
cppcheck_cunit:
cppcheck ./Fact_UnitTest > cppcheck_cunit.txt 2>&1
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter