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

Update Makefile

parent 7bdb587f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #6179 en échec
# Group: Q6
# Date: 24 April 2020
# Course: LEPL1503 - PROJECT3
# 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
fact: fact.c
$(CC) $(FLAGS) fact.c -o fact -lm
echo "fact.c file compiled"
# File provinding wrong numbers (negative, <2, 0), command:
# ./fact incorrect_numbers.txt out.txt
test: Fact_UnitTest.c
$(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:
rm fact
# rm testing ouput files ####
# rm Fact_UnitTest
# rm out*.txt
## ADDITIONAL MAKE COMMANDS:
## make cunit, make valgrind, make cppcheck, make valgrind_cunit, make cppcheck_cunit
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:
valgrind ./fact > valgrind_fact.txt 2>&1
cppcheck:
cppcheck ./fact > cppcheck_fact.txt 2>&1
valgrind_cunit:
valgrind ./Fact_UnitTest > valgrind_cunit.txt 2>&1
cppcheck_cunit:
cppcheck ./Fact_UnitTest > cppcheck_cunit.txt 2>&1
# Group: Q6 - gs
# Date: 23 April 2020
# Course: LEPL1503 - PROJECT3
# Object: factorial
CC = gcc
# The option -Werror convert warning into error
FLAGS = -Werror -pthread
#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
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"
clean: fact
rm fact
# rm testing ouput files ####
rm Fact_UnitTest
rm out*.txt
echo "Clean completed"
valgrind:
valgrind ./fact
valgrind_test:
valgrind ./Fact_UnitTest
cppcheck:
cppcheck ./fact
cppcheck_test:
cppcheck ./Fact_UnitTest
\ No newline at end of file
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