Commit 61411fe2ab2311385a6d8732bb25e5b2e0b67ba6

Thomas de Grivel 2023-11-14T15:27:31

add makefile for mac

diff --git a/libc3/window/cairo/quartz/libc3_window_cairo_quartz/libc3_window_cairo_quartz/Makefile b/libc3/window/cairo/quartz/libc3_window_cairo_quartz/libc3_window_cairo_quartz/Makefile
new file mode 100644
index 0000000..d38f80e
--- /dev/null
+++ b/libc3/window/cairo/quartz/libc3_window_cairo_quartz/libc3_window_cairo_quartz/Makefile
@@ -0,0 +1,31 @@
+# Compiler settings
+CC = clang
+SWIFT = swiftc
+CFLAGS = -I/opt/homebrew/include
+LDFLAGS = -L/opt/homebrew/lib -lcairo
+SWIFTCFLAGS = -import-objc-header "libc3_window_cairo_quartz-Bridging-Header.h"
+
+# Source files
+OBJC_SOURCES = custom_cairo_view.m
+SWIFT_SOURCES = main.swift ContentView.swift
+
+# Object files
+OBJC_OBJECTS = $(OBJC_SOURCES:.m=.o)
+SWIFT_OBJECTS = $(SWIFT_SOURCES:.swift=.o)
+
+# App binary
+APP_BINARY = c3_window_cairo_quartz_demo
+
+all: $(APP_BINARY)
+
+$(APP_BINARY): $(OBJC_OBJECTS) $(SWIFT_OBJECTS)
+    $(CC) $(LDFLAGS) -o $@ $^
+
+%.o: %.m
+    $(CC) $(CFLAGS) -c $< -o $@
+
+%.o: %.swift
+    $(SWIFT) $(SWIFTCFLAGS) -c $< -o $@
+
+clean:
+    rm -f $(APP_BINARY) $(OBJC_OBJECTS) $(SWIFT_OBJECTS)