From aea23b389a5eba09b3865209a08843e66481dd54 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 10 May 2020 12:13:55 +0200 Subject: Initial commit, SDL boilerplate --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3fa3dd --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +RM = rm -f +MKDIR = mkdir -p + +NAME = cardioid + +SRCDIR = src +INCDIR = inc +OBJDIR = obj + +CC = gcc +CCFLAGS = -Wall -Wextra -I$(INCDIR) $(shell sdl2-config --cflags) +LDFLAGS = $(shell sdl2-config --libs) + +SRC = $(shell find $(SRCDIR) -type f -name "*.c") +INC = $(shell find $(INCDIR) -type f -name "*.h") +OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) + +all: prebuild $(NAME) + +prebuild: + $(MKDIR) $(OBJDIR) + +$(NAME): $(OBJ) + $(CC) -o $@ $^ $(LDFLAGS) + +$(OBJDIR)/%.o: $(SRCDIR)/%.c $(INC) + $(CC) $(CCFLAGS) -c -o $@ $< + +clean: + $(RM) $(OBJ) + +fclean: clean + $(RM) $(NAME) + +re: fclean all -- cgit