aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..232508f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+NAME = mandel
+CC = gcc
+CCFLAGS = -Wall -Wextra
+LDFLAGS = -lm # $(shell sdl2-config --libs --cflags)
+
+HEADER = header.h
+SRC = main.c graphics.c mandelbrot.c
+OBJ = $(SRC:.c=.o)
+
+RM = rm -f
+
+.PHONY: all
+all: $(NAME)
+
+$(NAME): $(OBJ) $(HEADER)
+ $(CC) $(LDFLAGS) $(CCFLAGS) -o $@ $(OBJ)
+
+%.o: %.c
+ $(CC) $(LDFLAGS) $(CCFLAGS) -c -o $@ $<
+
+.PHONY: debug
+debug: CCFLAGS += -g
+debug: re
+
+.PHONY: clean
+clean:
+ $(RM) $(OBJ)
+
+.PHONY: fclean
+fclean: clean
+ $(RM) $(NAME)
+
+.PHONY: re
+re: fclean all