This commit is contained in:
relikd
2021-10-12 01:35:25 +02:00
commit 3775386aa2
9 changed files with 268 additions and 0 deletions

26
Makefile Executable file
View File

@@ -0,0 +1,26 @@
# usage: make [CONFIG=debug|release]
ifeq ($(CONFIG), debug)
CFLAGS=-Onone -g
else
CFLAGS=-O
endif
APP_DIR = Memmon.app/Contents
Memmon.app: SDK_PATH = $(shell xcrun --show-sdk-path --sdk macosx)
Memmon.app: src/*
mkdir -p Memmon.app/Contents/MacOS/
swiftc $(CFLAGS) src/main.swift \
-target arm64-apple-macos10.10 -target x86_64-apple-macos10.10 \
-emit-executable -sdk $(SDK_PATH) -o Memmon.app/Contents/MacOS/Memmon
mkdir -p Memmon.app/Contents/Resources/
cp src/AppIcon.icns Memmon.app/Contents/Resources/AppIcon.icns
cp src/Info.plist Memmon.app/Contents/Info.plist
echo 'APPL????' > Memmon.app/Contents/PkgInfo
@touch Memmon.app
.PHONY: release
release: VERSION=$(shell grep -A1 CFBundleShortVersionString src/Info.plist | tail -1 | tr -d '[a-z \t</>]')
release: Memmon.app
tar -czf "Memmon_v$(VERSION).tar.gz" Memmon.app