forked from FelixKratz/SketchyBar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
57 lines (43 loc) · 1.77 KB
/
makefile
File metadata and controls
57 lines (43 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
CFLAGS = -std=c99 -Wall -Ofast -ffast-math -fvisibility=hidden -fno-common
LIBS = -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreWLAN -framework IOKit -F/System/Library/PrivateFrameworks -framework SkyLight -framework DisplayServices
ODIR = bin
SRC = src
_OBJ = alias.o background.o bar_item.o custom_events.o event.o graph.o \
image.o mouse.o shadow.o font.o text.o message.o mouse.o bar.o \
window.o bar_manager.o display.o event_loop.o group.o mach.o popup.o \
animation.o workspace.om volume.o slider.o power.o wifi.om
OBJ = $(patsubst %, $(ODIR)/%, $(_OBJ))
.PHONY: all clean arm x86 profile leak universal
all: clean universal
leak: CFLAGS=-std=c99 -Wall -g
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
x86: CFLAGS+=-target x86_64-apple-macos10.13
x86: $(ODIR)/sketchybar
arm64: CFLAGS+=-target arm64-apple-macos11
arm64: $(ODIR)/sketchybar
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
debug: CFLAGS=-std=c99 -Wall -g
debug: arm64
asan: CFLAGS=-std=c99 -Wall -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
asan: clean arm64
./bin/sketchybar
$(ODIR)/sketchybar: $(SRC)/sketchybar.m $(OBJ) | $(ODIR)
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
$(ODIR)/%.o: $(SRC)/%.c $(SRC)/%.h | $(ODIR)
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/%.om: $(SRC)/%.m $(SRC)/%.h | $(ODIR)
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR):
mkdir $(ODIR)
clean:
rm -rf $(ODIR)