Thou shalt not cross 80 columns in thy file.

This commit is contained in:
2025-03-20 13:44:11 -07:00
parent c846fc5a15
commit c1056fad93
14 changed files with 665 additions and 297 deletions
+41 -24
View File
@@ -7,9 +7,13 @@ XCODE_PATH = $(shell xcode-select --print-path)
EXEC = CmdBar
SRCMODULES = UpdateManager.swift AboutViewController.swift AppDelegate.swift CBMenuBarItem.swift CircularProgressView.swift \
CmdManager.swift CmdViewController.swift CopyableTextView.swift EditableNSTextField.swift EventMonitor.swift Helpers.swift \
MenulessWindow.swift PopoverPanel.swift QuietView.swift UpdateViewController.swift main.swift
SRCMODULES = UpdateManager.swift AboutViewController.swift \
AppDelegate.swift CBMenuBarItem.swift \
CircularProgressView.swift CmdManager.swift \
CmdViewController.swift CopyableTextView.swift \
EditableNSTextField.swift EventMonitor.swift Helpers.swift \
MenulessWindow.swift PopoverPanel.swift QuietView.swift \
UpdateViewController.swift main.swift
ARMOBJMODULES = $(addprefix ./arm64/,$(SRCMODULES:.swift=.o))
X86OBJMODULES = $(addprefix ./x86_64/,$(SRCMODULES:.swift=.o))
@@ -19,40 +23,51 @@ FRAMEWORKS = -framework AppKit -framework ServiceManagement
LIBS = -lzip
zip:
@$(MAKE) -C libs/Zip/Zip FLAGS=$(FLAGS) CFLAGS=$(CFLAGS) MACOS_VERSION=$(MACOS_VERSION) all
@$(MAKE) -C libs/Zip/Zip FLAGS=$(FLAGS) CFLAGS=$(CFLAGS) \
MACOS_VERSION=$(MACOS_VERSION) all
cmdbar_updater:
@$(MAKE) -C updater FLAGS=$(FLAGS) all
@cp updater/$@ .
./arm64/%.o: %.swift
swift -frontend -c $(if $(DEBUG), -D DEBUG,) -target arm64-apple-macos$(MACOS_VERSION) $(FLAGS) \
swift -frontend -c $(if $(DEBUG), -D DEBUG,) \
-target arm64-apple-macos$(MACOS_VERSION) $(FLAGS) \
-I./libs/Zip/Zip -I./libs/Zip/Zip/arm64 -L./libs/Zip/Zip/arm64 \
-primary-file $< $(filter-out $<, $(SRCMODULES)) $(LIBS) -sdk $(SDK) -module-name $(EXEC) \
-o $@ -emit-module && touch $@
-primary-file $< $(filter-out $<, $(SRCMODULES)) $(LIBS) \
-sdk $(SDK) -module-name $(EXEC) -o $@ -emit-module && touch $@
ifdef UNIVERSAL
./x86_64/%.o: %.swift
@swift -frontend -c $(if $(DEBUG), -D DEBUG,) -target x86_64-apple-macos$(MACOS_VERSION) $(FLAGS) \
@swift -frontend -c $(if $(DEBUG), -D DEBUG,) \
-target x86_64-apple-macos$(MACOS_VERSION) $(FLAGS) \
-I./libs/Zip/Zip -I./libs/Zip/Zip/x86_64 -L./libs/Zip/Zip/x86_64 \
-primary-file $< $(filter-out $<, $(SRCMODULES)) $(LIBS) -sdk $(SDK) -module-name $(EXEC) \
-o $@ -emit-module && touch $@
-primary-file $< $(filter-out $<, $(SRCMODULES)) $(LIBS) \
-sdk $(SDK) -module-name $(EXEC) -o $@ -emit-module && touch $@
endif
./arm64/$(EXEC): $(ARMOBJMODULES)
@ld -syslibroot $(SDK) -lSystem -arch arm64 -macos_version_min $(MACOS_VERSION).0 \
@ld -syslibroot $(SDK) -lSystem -arch arm64 \
-macos_version_min $(MACOS_VERSION).0 \
/Library/Developer/CommandLineTools/usr/lib/swift/macosx/libswiftCompatibilityPacks.a \
-sectcreate __TEXT __info_plist Info.plist -L /Library/Developer/CommandLineTools/usr/lib/swift/macosx -L \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/swift -no_objc_category_merging -L $(XCODE_PATH) -rpath \
Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx ./arm64/main.o $(filter-out ./arm64/main.o, $(ARMOBJMODULES)) \
-sectcreate __TEXT __info_plist Info.plist \
-L /Library/Developer/CommandLineTools/usr/lib/swift/macosx -L \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/swift \
-no_objc_category_merging -L $(XCODE_PATH) \
-rpath Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \
./arm64/main.o $(filter-out ./arm64/main.o, $(ARMOBJMODULES)) \
./libs/Zip/Zip/arm64/libzip.a -o $@
ifdef UNIVERSAL
./x86_64/$(EXEC): $(X86OBJMODULES)
@ld -syslibroot $(SDK) -lSystem -arch x86_64 -macos_version_min $(MACOS_VERSION).0 \
@ld -syslibroot $(SDK) -lSystem -arch x86_64 \
-macos_version_min $(MACOS_VERSION).0 \
/Library/Developer/CommandLineTools/usr/lib/swift/macosx/libswiftCompatibilityPacks.a \
-sectcreate __TEXT __info_plist Info.plist -L /Library/Developer/CommandLineTools/usr/lib/swift/macosx -L \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/swift -no_objc_category_merging -L $(XCODE_PATH) -rpath \
Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx ./x86_64/main.o $(filter-out ./x86_64/main.o, $(X86OBJMODULES)) \
-sectcreate __TEXT __info_plist Info.plist \
-L /Library/Developer/CommandLineTools/usr/lib/swift/macosx -L \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/swift \
-no_objc_category_merging -L $(XCODE_PATH) \
-rpath Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \
./x86_64/main.o $(filter-out ./x86_64/main.o, $(X86OBJMODULES)) \
./libs/Zip/Zip/x86_64/libzip.a -o $@
endif
@@ -72,20 +87,22 @@ $(EXEC).app: $(EXEC)
cp resources/AppIcon.icns $@/Contents/Resources/ && \
cp $(EXEC) $@/Contents/MacOS/ && \
cp cmdbar_updater $@/Contents/MacOS/ && \
$(if $(DEBUG), codesign --entitlements Grapp.entitlements -s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp -o runtime $(EXEC).app)
$(if $(DEBUG), codesign --entitlements Grapp.entitlements \
-s ${APPLE_DEVELOPMENT} -f --timestamp -o runtime $(EXEC).app, \
codesign -s ${APPLE_DEVELOPER_ID_APPLICATION} -f --timestamp \
-o runtime $(EXEC).app)
all: zip cmdbar_updater $(EXEC).app
clear:
clear
kill:
-pkill $(EXEC)
run: clear kill all
run: kill all
./$(EXEC)
open: kill all
open $(EXEC).app
clean:
rm -rf $(EXEC) $(EXEC).app cmdbar_updater arm64 x86_64
mkdir arm64 x86_64