diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -1,9 +1,31 @@ -CC = gcc -CFLAGS = -Wall -W -std=c99 -g -god_hands_solver: god_hands.o +CC ?= gcc +CFLAGS += -W -Wall -std=gnu99 -Wextra +LDFLAGS += +NAME = god_hands_solver +SRC = god_hands.c + +all: depend $(NAME) + +depend: .depend + +.depend: $(SRC) + @$(RM) .depend + @$(CC) $(CFLAGS) -MM $^ > .depend + +include .depend + +OBJ = $(SRC:.c=.o) + +$(NAME): $(OBJ) $(CC) -o $@ $^ $(LDFLAGS) -god_hands.o: god_hands.c - $(CC) -o $@ -c $< $(CFLAGS) +clean: + $(RM) $(OBJ) + +fclean: clean + $(RM) $(NAME) + +re: fclean all +.PHONY: all depend clean fclean all re |