code_analyzer/Makefile

54 lines
1.0 KiB
Makefile
Raw Normal View History

2022-01-07 12:52:33 +01:00
CC = cc
CFLAGS = -Wall -Wextra -Werror -O3
NAME = code-analyzer
AUTHOR = Volodymyr_Patuta
2022-01-08 13:54:02 +01:00
VERSION = 1.1.0
SRCDIR = ./src
SRCS = $(shell find $(SRCDIR) -name '*.c')
HEADERS = $(shell find $(SRCDIR) -name '*.h')
OBJS = $(SRCS:.c=.o)
RM = rm -f
TAR = tar
MKDIR = mkdir
CHMOD = chmod
CP = rsync -Rr
2022-01-07 12:52:33 +01:00
EXTRAFILES = LICENSE README.md test.c .clang-format rapport.pdf
DISTFILES = $(SRCDIR) Makefile $(EXTRAFILES)
distdir = $(AUTHOR)-$(NAME)-$(VERSION)
all: $(NAME)
graph:
2022-01-07 12:52:33 +01:00
dot -Tps:cairo:cairo graph.dot | ps2pdf - > graph.pdf
debug: CFLAGS += -DDEBUG -g
debug: $(NAME)
$(SRC_DIR)/%.o: %.c
$(CC) $(CFLAGS) $< -c
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $^ -o $(NAME)
dist: distdir
$(CHMOD) -R a+r $(distdir)
$(TAR) zcvf $(distdir).tgz $(distdir)
$(RM) -r $(distdir)
distdir: $(DISTFILES)
$(RM) -r $(distdir)
$(MKDIR) $(distdir)
$(CHMOD) 777 $(distdir)
$(CP) $(DISTFILES) $(distdir)
clean:
2022-01-02 16:48:29 +01:00
$(RM) $(OBJS)
fclean: clean
2022-01-04 14:14:52 +01:00
$(RM) $(NAME) graph.dot graph.pdf
.PHONY: all clean fclean re dist distdir debug