Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CC=gcc
- LDFLAGS=-L. -ls21_string
- SOURCES=s21_string.c
- OBJECTS=$(SOURCES:.c=.o)
- GCOVFLAGS=--coverage
- HTML_CREATE=lcov -t a.out -o rep.info -c -d .; genhtml -o report rep.info
- OS=$(shell uname)
- ifeq ($(OS), Linux)
- CHECK_FLAGS= -lcheck -pthread -lrt -lm
- fctvFl=-D_DEFAULT_SOURCE
- OS_ERR=-DLINUX
- else
- CHECK_FLAGS=`pkg-config --cflags --libs check`
- OS_ERR=-DMACOS
- endif
- TEST_COMPILE=$(CC) test/tests.c libs21_string.a $(CHECK_FLAGS) -L. -ls21_string
- all:clean s21_string.a test
- clean:
- rm -rf *.o *.g* *.info *.out report *.a
- rebuild: clean all
- test: s21_string.a
- $(TEST_COMPILE)
- ./a.out
- gcov_report: s21_string.a
- rm -f *.g*
- $(CC) $(SOURCES) test/tests.c libs21_string.a $(CHECK_FLAGS) $(LDFLAGS) $(GCOVFLAGS)
- ./a.out
- $(HTML_CREATE)
- s21_string.a: s21_string.o
- ar rcs libs21_string.a s21_string.o
- ranlib libs21_string.a
- cp libs21_string.a s21_string.a
- cp libs21_string.a ls21_string.a
- s21_string.o:
- $(CC) -c s21_string.c $(OS_ERR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement