diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:30:20 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:31:01 +0100 |
commit | 54f40f6cb863f00fbcaa77ebdb930d8d7fc6988d (patch) | |
tree | 0757b1da4f95b1096877fcbd101ef7edf923b4ce /Makefile |
Imported the code into Git
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c458a47 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +NAME = $(notdir $(CURDIR)) +SRC = $(addprefix src/,main.c init.c move.c flip.c flag.c xSDL.c) + +CPPFLAGS = -I./include $(shell sdl-config --cflags) +CPPFLAGS += -I../lib/sdl-digit/include +LDFLAGS = -L../lib/sdl-digit -L./lib $(shell sdl-config --libs) -lsdl-digit +CFLAGS = -W -Wall -Wextra -std=gnu99 $(shell sdl-config --cflags) + +CC = gcc + +OBJ = $(SRC:.c=.o) +DEP = $(SRC:.c=.d) + +all: $(NAME) + +$(NAME): $(OBJ) + $(CC) -o "$@" $^ $(LDFLAGS) + +-include $(DEP) + +%.d: %.c + $(CC) -MM $(CPPFLAGS) $(CFLAGS) $< -MF $@ -MT "$*.o $@" + +clean: + $(RM) $(OBJ) + $(RM) $(NAME) + +mrproper: clean + $(RM) $(DEP) + +distclean: mrproper + $(RM) $(addsuffix ~,$(SRC)) + $(RM) $(wildcard $(addsuffix .sw*,$(addprefix .,$(SRC)))) + +.PHONY: all clean mrproper distclean + |