aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 31 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a3bf008..5947638 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,31 @@
-all:
- go mod tidy
- go build
- gofmt -l -s -w .
+CFLAGS = -ansi -Wall -Wextra -pedantic -Wno-deprecated-declarations
+LDFLAGS = $(shell sdl2-config --libs)
+
+# Link OpenGL.
+ifeq ($(OS),Windows_NT)
+ GLFLAG := -lopengl32
+else
+ UNAME := `uname -o 2>/dev/null || uname -s`
+ ifeq ($(UNAME),"Darwin")
+ GLFLAG := -framework OpenGL
+ else
+ GLFLAG := -lGL
+ endif
+endif
+LDFLAGS += $(GLFLAG)
+
+SRC = main.c microui.c
+OBJ = ${SRC:.c=.o}
+
+all: volute
+
+clean:
+ rm -f volute *.o
+
+volute: ${OBJ}
+ ${CC} -o $@ $^ ${LDFLAGS}
+
+%.o: %.c
+ ${CC} -c ${CFLAGS} $<
+
+${SRC}: microui.h