diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..62eefa6 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +CC ?= gcc +CFLAGS += -W -Wall -std=c99 -Wextra +CFLAGS += -I./ +CFLAGS += -D _GNU_SOURCE +NAME = librb.a +SRC = src/rb.c + +AR = ar rc + +all: depend $(NAME) + +depend: .depend + +.depend: $(SRC) + @$(RM) .depend + @$(CC) $(CFLAGS) -MM $^ > .depend + +include .depend + +OBJ = $(SRC:.c=.o) + +$(NAME): $(OBJ) + $(AR) $(NAME) $(OBJ) + ranlib $(NAME) + +clean: + $(RM) $(OBJ) + +fclean: clean + $(RM) $(NAME) + +re: fclean all + +.PHONY: all depend clean fclean all re |