Advertisement
2607

make

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