SketchyBar/makefile

58 lines
1.7 KiB
Makefile
Raw Normal View History

2022-12-23 22:00:33 +00:00
CFLAGS = -std=c99 -Wall -Ofast -ffast-math -fvisibility=hidden -fno-common
LIBS = -framework Carbon -framework Cocoa -framework CoreAudio -F/System/Library/PrivateFrameworks -framework SkyLight -framework DisplayServices
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 \
animation.o workspace.om volume.o slider.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-12-23 22:00:33 +00:00
leak: CFLAGS=-std=c99 -Wall -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
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-12-23 22:00:33 +00:00
debug: CFLAGS=-std=c99 -Wall -g
debug: arm64
2022-12-23 22:00:33 +00:00
asan: CFLAGS=-std=c99 -Wall -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
asan: clean arm64
2022-03-20 21:16:38 +00:00
./bin/sketchybar
2022-03-20 21:16:38 +00:00
$(ODIR)/sketchybar: $(SRC)/sketchybar.m $(OBJ) | $(ODIR)
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
2022-03-20 21:16:38 +00:00
$(ODIR)/%.o: $(SRC)/%.c $(SRC)/%.h | $(ODIR)
$(CC) -c -o $@ $< $(CFLAGS)
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)