Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OS := $(shell uname -s)
- ifeq ($(OS), Darwin)
- CHECK=-lcheck
- else
- CHECK=-lcheck -lsubunit -lm -lrt -lpthread -D_GNU_SOURCE
- endif
- all: s21_cat s21_grep test
- test: unittest.o
- sh test.sh
- gcc unittest.o -o a.out $(CHECK)
- s21_cat.o: cat/s21_cat.c
- gcc -Wall -Werror -Wextra -c cat/s21_cat.c -o cat/s21_cat.o
- s21_grep.o: grep/s21_grep.c
- gcc -Wall -Werror -Wextra -c grep/s21_grep.c -o grep/s21_grep.o
- s21_cat: cat/s21_cat.o
- gcc cat/s21_cat.o -o cat/s21_cat
- s21_grep: grep/s21_grep.o
- gcc grep/s21_grep.o -o grep/s21_grep -D_GNU_SOURCE
- clean:
- rm -rf cat/s21_cat.o grep/s21_grep.o
- rm -rf cat/s21_cat grep/s21_grep
- rm -rf a.out
- rm -rf s21_cat_lot.txt
- rm -rf s21_grep_lot.txt
- rm -rf *.o
- unittest.o: test.c
- gcc -Wall -Werror -Wextra -c test.c -o unittest.o
- rebuild: clean all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement