From 4ba873caba1d725aa72a135e4bd5fc69a9b7ef64 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sun, 16 Feb 2025 11:52:23 -0500 Subject: microui --- Makefile | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3