2022-06-10 08:02:45 +00:00
|
|
|
CFLAGS = -std=c99 -Wall -DNDEBUG -Ofast -ffast-math -fvisibility=hidden -fno-common
|
2022-10-09 14:21:22 +00:00
|
|
|
LIBS = -framework Carbon -framework Cocoa -framework CoreAudio -F/System/Library/PrivateFrameworks -framework SkyLight
|
2022-03-20 21:16:38 +00:00
|
|
|
ODIR = bin
|
|
|
|
SRC = src
|
2020-03-29 10:22:38 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
_OBJ = alias.o background.o bar_item.o custom_events.o event.o graph.o \
|
2022-07-02 10:12:04 +00:00
|
|
|
image.o mouse.o shadow.o text.o message.o mouse.o bar.o window.o \
|
2022-05-16 13:00:39 +00:00
|
|
|
bar_manager.o display.o event_loop.o group.o mach.o popup.o \
|
2022-10-09 14:21:22 +00:00
|
|
|
animation.o workspace.om volume.o
|
2022-03-20 21:16:38 +00:00
|
|
|
OBJ = $(patsubst %, $(ODIR)/%, $(_OBJ))
|
2020-03-29 10:22:38 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
.PHONY: all clean arm x86 profile leak universal
|
2020-03-29 10:22:38 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
all: clean universal
|
2021-09-27 16:31:47 +00:00
|
|
|
|
2022-03-24 19:33:14 +00:00
|
|
|
leak: CFLAGS=-std=c99 -Wall -DDEBUG -g
|
2022-03-20 21:16:38 +00:00
|
|
|
leak: clean arm64
|
|
|
|
leak:
|
|
|
|
/usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" bin/tmp.entitlements
|
|
|
|
codesign -s - --entitlements bin/tmp.entitlements -f ./bin/sketchybar
|
|
|
|
leaks -atExit -- ./bin/sketchybar
|
2021-09-27 16:31:47 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
x86: CFLAGS+=-target x86_64-apple-macos10.13
|
|
|
|
x86: $(ODIR)/sketchybar
|
2021-08-18 21:14:27 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
arm64: CFLAGS+=-target arm64-apple-macos11
|
|
|
|
arm64: $(ODIR)/sketchybar
|
2021-09-01 11:22:39 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
universal:
|
|
|
|
$(MAKE) x86
|
|
|
|
mv $(ODIR)/sketchybar $(ODIR)/sketchybar_x86
|
|
|
|
rm -rf $(ODIR)/*.o*
|
|
|
|
$(MAKE) arm64
|
|
|
|
mv $(ODIR)/sketchybar $(ODIR)/sketchybar_arm64
|
|
|
|
lipo -create -output $(ODIR)/sketchybar $(ODIR)/sketchybar_x86 $(ODIR)/sketchybar_arm64
|
2021-10-02 22:48:25 +00:00
|
|
|
|
2022-03-24 19:33:14 +00:00
|
|
|
debug: CFLAGS=-std=c99 -Wall -DDEBUG -g
|
|
|
|
debug: arm64
|
|
|
|
|
|
|
|
asan: CFLAGS=-std=c99 -Wall -DDEBUG -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
|
|
|
asan: clean arm64
|
2022-03-20 21:16:38 +00:00
|
|
|
./bin/sketchybar
|
2021-12-25 19:45:06 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
$(ODIR)/sketchybar: $(SRC)/sketchybar.m $(OBJ) | $(ODIR)
|
|
|
|
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
2021-12-25 19:45:06 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
$(ODIR)/%.o: $(SRC)/%.c $(SRC)/%.h | $(ODIR)
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2021-09-01 10:08:06 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
$(ODIR)/%.om: $(SRC)/%.m $(SRC)/%.h | $(ODIR)
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2021-09-26 12:50:17 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
$(ODIR):
|
|
|
|
mkdir $(ODIR)
|
2021-09-26 12:50:17 +00:00
|
|
|
|
2022-03-20 21:16:38 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(ODIR)
|