From 477a1ca6d086b9ee783a0465acf443d4211bc073 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 6 Aug 2015 00:46:50 +0100 Subject: god_hands_solver: use the new version of the Makefile Signed-off-by: Olivier Gayot --- Makefile | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f96eb32..a571f6c 100644 --- a/Makefile +++ b/Makefile @@ -14,33 +14,37 @@ ## with this program; if not, write to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -CC ?= gcc -CFLAGS += -W -Wall -std=gnu99 -Wextra -LDFLAGS += -NAME = god_hands_solver -SRC = god_hands.c +NAME = god_hands_solver +SRC = $(wildcard *.c) -all: depend $(NAME) +CPPFLAGS = +LDFLAGS = +CFLAGS = -W -Wall -Wextra -std=gnu99 -depend: .depend +CC = gcc -.depend: $(SRC) - @$(RM) .depend - @$(CC) $(CFLAGS) -MM $^ > .depend +OBJ = $(SRC:.c=.o) +DEP = $(SRC:.c=.d) --include .depend - -OBJ = $(SRC:.c=.o) +all: $(NAME) $(NAME): $(OBJ) $(CC) -o $@ $^ $(LDFLAGS) +-include $(DEP) + +%.d: %.c + $(CC) -MM $(CPPFLAGS) $(CFLAGS) $< -MF $@ -MT "$*.o $@" + clean: $(RM) $(OBJ) - -fclean: clean $(RM) $(NAME) -re: fclean all +mrproper: clean + $(RM) $(DEP) + +distclean: mrproper + $(RM) $(addsuffix ~,$(SRC)) + $(RM) $(wildcard $(addsuffix .sw*,$(addprefix .,$(SRC)))) -.PHONY: all depend clean fclean all re +.PHONY: all clean mrproper distclean -- cgit v1.2.3