Advertisement
2607

make

Nov 24th, 2021
2,717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.22 KB | None | 0 0
  1. CC=gcc
  2. CFLAGS=-Wall -Werror -Wextra
  3. LIBS=-pthread -lcheck_pic -pthread -lrt -lm -lsubunit
  4. #LIBS=-I -L
  5. # BREWH=$(shell brew config | grep HOMEBREW_PREFIX | cut -d' ' -f2-)
  6. # KAMPUS $(CC) -o tests.out tests.c s21_string.c -I -L -lcheck
  7. # HOME $(CC) -o tests.out tests.c s21_string.c -I../../homebrew/include -L/usr/local/Cellar/check/0.15.2/lib -lcheck
  8. # $(CC) --coverage -o tests.out tests.c s21_string.c -pthread -lcheck_pic -pthread -lrt -lm -lsubunit
  9. all:
  10.     make s21_string.a
  11.     make gcov_report
  12.  
  13.  
  14. s21_string.a: s21_string.c s21_string.h
  15.     $(CC) -c s21_string.c -o s21_string.o
  16.     ar rc s21lib.a s21_string.o
  17.  
  18. s21_string_test: s21_test.c
  19.     $(CC) --coverage -c s21_test.c $(LIBS)
  20.     $(CC) -c s21_string.c $(LIBS)
  21.     $(CC) --coverage -o s21_test.out s21_test.o s21_string.o $(LIBS) -lcheck
  22. #-fprofile-arcs -ftest-coverage
  23. #   $(CC) -fprofile-arcs -ftest-coverage -c s21_test.c $(LIBS)
  24. #   $(CC) -c s21_string.c $(LIBS)
  25. #   $(CC) -fprofile-arcs -ftest-coverage -o s21_test.out s21_test.o s21_string.o $(LIBS)
  26.  
  27. test: s21_string_test
  28.     ./s21_test.out
  29.  
  30. gcov_report: test
  31.     lcov -t "test" -o test.info -c -d .
  32.     genhtml -o report test.info
  33.  
  34. clean:
  35.     rm -rf *.o *.a *.out *.gcno *.gcda *.info
  36.  
  37. main:
  38.  
  39. rebuild:
  40.     make clean
  41.     make all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement