diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-10 12:13:55 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-10 12:13:55 +0200 |
| commit | aea23b389a5eba09b3865209a08843e66481dd54 (patch) | |
| tree | 4840787b9cdebaa998808ef1399a4bf4c76a75a3 /Makefile | |
| download | cardioid-aea23b389a5eba09b3865209a08843e66481dd54.tar.gz cardioid-aea23b389a5eba09b3865209a08843e66481dd54.tar.bz2 cardioid-aea23b389a5eba09b3865209a08843e66481dd54.zip | |
Initial commit, SDL boilerplate
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
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 |
