SketchyBar/makefile

49 lines
1.6 KiB
Makefile
Raw Normal View History

2020-03-29 10:22:38 +00:00
FRAMEWORK_PATH = -F/System/Library/PrivateFrameworks
2021-09-07 15:51:20 +00:00
FRAMEWORK = -framework Carbon -framework Cocoa -framework SkyLight
2021-09-26 12:50:17 +00:00
BUILD_FLAGS = -std=c99 -Wall -DNDEBUG -Ofast -fvisibility=hidden
2020-03-29 10:22:38 +00:00
BUILD_PATH = ./bin
2021-09-11 21:22:51 +00:00
SKETCHYBAR_SRC = ./src/manifest.m
2021-09-27 16:31:47 +00:00
UNIVERSAL_BINS = $(BUILD_PATH)/sketchybar
ARM_BINS = $(BUILD_PATH)/sketchybar_arm
x86_BINS = $(BUILD_PATH)/sketchybar_x86
2020-03-29 10:22:38 +00:00
2021-09-11 21:22:51 +00:00
.PHONY: all clean install
2020-03-29 10:22:38 +00:00
2021-09-27 16:31:47 +00:00
all: clean $(UNIVERSAL_BINS)
2020-03-29 10:22:38 +00:00
2021-09-27 16:31:47 +00:00
arm: clean $(ARM_BINS)
x86: clean $(x86_BINS)
install: clean $(UNIVERSAL_BINS)
2021-08-14 20:42:59 +00:00
ln ./bin/sketchybar /usr/local/bin/sketchybar
2021-09-06 13:17:15 +00:00
echo "Install complete... Do not forget to setup the configuration file."
2021-09-01 11:22:39 +00:00
uninstall: clean
rm /usr/local/bin/sketchybar
2021-10-02 22:48:25 +00:00
profile: BUILD_FLAGS=-std=c99 -Wall -DDEBUG -g -Ofast -fvisibility=hidden
profile: clean $(x86_BINS)
2021-09-26 12:50:17 +00:00
debug: BUILD_FLAGS=-std=c99 -Wall -DDEBUG -fsanitize=address -fsanitize=undefined -g -O0 -fvisibility=hidden
2021-09-27 16:31:47 +00:00
debug: clean $(x86_BINS)
2021-09-27 16:31:47 +00:00
update: clean $(UNIVERSAL_BINS)
rm /usr/local/bin/sketchybar
ln ./bin/sketchybar /usr/local/bin/sketchybar
echo "Update complete... ~/.config/ folder not touched and might need update too...."
2021-08-14 20:42:59 +00:00
2020-03-29 10:22:38 +00:00
clean:
rm -rf $(BUILD_PATH)
2021-09-26 12:50:17 +00:00
$(BUILD_PATH)/sketchybar_x86: $(SKETCHYBAR_SRC)
2020-03-29 10:22:38 +00:00
mkdir -p $(BUILD_PATH)
2021-09-26 12:50:17 +00:00
clang $^ $(BUILD_FLAGS) -target x86_64-apple-macos10.13 $(FRAMEWORK_PATH) $(FRAMEWORK) -o $@
$(BUILD_PATH)/sketchybar_arm: $(SKETCHYBAR_SRC)
mkdir -p $(BUILD_PATH)
clang $^ $(BUILD_FLAGS) -target arm64-apple-macos11 $(FRAMEWORK_PATH) $(FRAMEWORK) -o $@
$(BUILD_PATH)/sketchybar: $(BUILD_PATH)/sketchybar_arm $(BUILD_PATH)/sketchybar_x86
lipo -create -output $(BUILD_PATH)/sketchybar $(BUILD_PATH)/sketchybar_x86 $(BUILD_PATH)/sketchybar_arm