From 0f5a18991f320a2df370994326f882a144c45b02 Mon Sep 17 00:00:00 2001
From: Nicholas Tay <nick@windblume.net>
Date: Thu, 3 Nov 2022 00:56:38 +1100
Subject: Initial macOS support (key hooking only, no sound yet)

Thought I'd commit this first, since it'll be some Objective-C stuff
coming (tested it out in another mini probe). Mostly has stuff similar
to Linux so probably should abstract some out to *nix common. But uses
IOKit to get into the typing events.

Will use Obj-C for now for sound, since it'll probably be a NSSound
thing, hooked up with NSCache (like Linux) to reduce loading into NS
format multiple times. Also probably would need to free the sound object
on finish sound, and not sure how I'd do Obj-C delegates from C... it
would be fun to figure it out though eventually

Also switched the Makefile to use clang, it's warnings do seem to be
nicer :) and is what `gcc` is aliased to on a Mac by default anyway.
---
 board/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'board')

diff --git a/board/Makefile b/board/Makefile
index ae3d691..ba53910 100644
--- a/board/Makefile
+++ b/board/Makefile
@@ -6,8 +6,14 @@ CFLAGS += -std=c99 -Wall -Wextra -Wshadow -Werror -pedantic -shared
 ifeq ($(OS),Windows_NT)
 	OUTEXT = dll
 else
-	OUTEXT = so
 	CFLAGS += -fPIC
+
+	UNAME_S := $(shell uname)
+	ifeq ($(UNAME_S),Linux)
+		OUTEXT = so
+	else ifeq ($(UNAME_S),Darwin)
+		OUTEXT = dylib
+	endif
 endif
 
 default: all
-- 
cgit