forked from nriley/brightness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·46 lines (34 loc) · 1.21 KB
/
Makefile
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
#!/usr/bin/env make -f
# Makefile to build brightness
# originally by Jon Stacey <[email protected]>
prefix=/usr/local
CFLAGS_X86_64 = $(CFLAGS) -target x86_64-apple-macos10.8
CFLAGS_ARM64 = $(CFLAGS) -target arm64-apple-macos11
override LDFLAGS += -framework IOKit \
-framework ApplicationServices \
-framework CoreDisplay \
-F /System/Library/PrivateFrameworks \
-framework DisplayServices \
-Wl,-U,_CoreDisplay_Display_SetUserBrightness \
-Wl,-U,_CoreDisplay_Display_GetUserBrightness \
-Wl,-U,_DisplayServicesCanChangeBrightness \
-Wl,-U,_DisplayServicesBrightnessChanged \
-Wl,-U,_DisplayServicesGetBrightness \
-Wl,-U,_DisplayServicesSetBrightness \
all: build
build: brightness
brightness: brightness.x86_64 brightness.arm64
/usr/bin/lipo -create -output $@ $^
brightness.x86_64: brightness.x86_64.o
$(CC) $(CFLAGS_X86_64) $(LDFLAGS) $^ -o $@
brightness.arm64: brightness.arm64.o
$(CC) $(CFLAGS_ARM64) $(LDFLAGS) $^ -o $@
%.x86_64.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS_X86_64) $< -c -o $@
%.arm64.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS_ARM64) $< -c -o $@
clean:
/bin/rm -f brightness brightness.x86_64 brightness.arm64 *.o
install:
/bin/mkdir -p $(prefix)/bin
/usr/bin/install -s -m 0755 brightness $(prefix)/bin