summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..21cc9eb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+CC := gcc
+LD := $(CC)
+SRC := $(wildcard *.c)
+OBJ := $(patsubst %.c,%.o,$(SRC))
+NAME := bozo
+SDL2-CFG := sdl2-config
+CFLAGS := -Wall -Wextra -std=c99 $(shell $(SDL2-CFG) --cflags)
+LDFLAGS := $(shell $(SDL2-CFG) --libs) -lSDL2_image -lSDL2_mixer -lSDL2_gfx
+
+all: $(NAME)
+
+$(NAME): $(OBJ)
+ $(LD) -o $(NAME) $(OBJ) $(LDFLAGS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+run: $(NAME)
+ ./$(NAME)
+
+clean:
+ rm -f $(NAME) $(OBJ)
+
+re:
+ make --no-print clean
+ make --no-print all
+
+.PHONY: all run clean re