-name := CydgetLoader
-flags := -framework UIKit -framework AddressBook
-base := $(shell cd ~; pwd)/menes/tweaks
-include $(base)/tweak.mk
+webcore := WebCore-514
+jscore := JavaScriptCore-521
-all: WebCycriptLockScreen
+cycc = cycc -i2.0 -o$@ -- $(filter %.mm,$^) -Xarch_armv6 -marm -g0 -O2 -I. -F/System/Library/PrivateFrameworks
-WebCycriptLockScreen: LockScreen.mm makefile $(base)/../mobilesubstrate/substrate.h
- $(target)g++ -bundle -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -lobjc -I$(base)/../mobilesubstrate $(link) $(flags) -framework CoreGraphics -framework QuartzCore -framework SpringBoardUI -framework WebCore -framework GraphicsServices -framework TelephonyUI
+all: CydgetLoader.dylib WebCycriptLockScreen CydgetSettings
+
+clean::
+ rm -f CydgetLoader.dylib CydgetSettings WebCycriptLockScreen
+
+CydgetLoader.dylib: CydgetLoader.mm makefile
+ $(cycc) -dynamiclib -framework Foundation -framework UIKit -framework CydiaSubstrate
+
+CydgetSettings: CydgetSettings.mm makefile
+ $(cycc) -dynamiclib -framework Foundation -framework UIKit -framework Preferences
+
+WebCycriptLockScreen: LockScreen.mm yieldToSelector.mm makefile
+ $(cycc) -bundle -isystem sysroot/usr/include \
+ -I$(jscore) -iquote$(jscore)/{parser,runtime} \
+ -framework Foundation -framework UIKit \
+ -framework CydiaSubstrate -framework CFNetwork \
+ -framework JavaScriptCore -framework WebKit \
+ -framework TelephonyUI -framework SpringBoardUI \
+ -Xarch_armv6 -Lsysroot/usr/lib -Xarch_armv6 -lpcre \
+ -Xarch_arm64 -DUSE_ICU_REGEX -Xarch_arm64 -licucore \
+ -Wl,-U,__ZN3JSC7UString3Rep7destroyEv \
+ -Wl,-U,__ZN3JSC7UStringC1EPKc \
+ -Wl,-U,__ZN3JSC7UStringC1EPKti \
+ -Wl,-U,__ZNK3JSC7UString6substrEii \
+ -Wno-mismatched-tags -Wno-tautological-constant-out-of-range-compare
+ install_name_tool -change /System/Library/{,Private}Frameworks/JavaScriptCore.framework/JavaScriptCore $@
ldid -S $@
-extra:
- mkdir -p package/System/Library/LockCydgets/CydgetCentral.cydget
- cp -a CydgetCentral.plist package/System/Library/LockCydgets/CydgetCentral.cydget/Info.plist
+deb: all
+ rm -rf package
+ mkdir -p package/DEBIAN
+ mkdir -p package/Library/MobileSubstrate/DynamicLibraries
+ sed -e 's/%/$(shell cycc -V)/' control.in >package/DEBIAN/control
+ mkdir -p package/Library/PreferenceLoader/Preferences;
+ cp -a CydgetLoader.{dylib,plist} package/Library/MobileSubstrate/DynamicLibraries
+ mkdir -p package/System/Library/LockCydgets
+ cp -a Welcome.cydget package/System/Library/LockCydgets/Welcome.cydget
+ cp -a AwayView.cydget package/System/Library/LockCydgets/AwayView.cydget
+ cp -a PhotoExample.cydget package/System/Library/LockCydgets/PhotoExample.cydget
+ cp -a PhotoExamplePlus.cydget package/System/Library/LockCydgets/PhotoExamplePlus.cydget
mkdir -p package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle
cp -a Info.plist package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle
cp -a WebCycriptLockScreen package/System/Library/SpringBoardPlugins/WebCycriptLockScreen.bundle
+ mkdir -p package/Library/PreferenceLoader/Preferences
+ mkdir -p package/System/Library/PreferenceBundles
+ cp -a CydgetSettings.plist package/Library/PreferenceLoader/Preferences
+ cp -a CydgetSettings.bundle package/System/Library/PreferenceBundles/CydgetSettings.bundle
+ cp -a Icon-Small.png package/System/Library/PreferenceBundles/CydgetSettings.bundle/icon.png
+ cp -a SearchResultsCheckmarkClear.png CydgetSettings package/System/Library/PreferenceBundles/CydgetSettings.bundle
+ deb=$$(grep ^Package: package/DEBIAN/control | cut -d ' ' -f 2-)_$$(grep ^Version: package/DEBIAN/control | cut -d ' ' -f 2)_iphoneos-arm.deb; dpkg-deb -b package "$$deb"; ln -sfv "$$deb" cydget.deb