+flags :=
+link :=
+libs :=
+
+dpkg := dpkg-deb -Zlzma
+
+flags += -F$(sdk)/System/Library/PrivateFrameworks
+flags += -I. -isystem sysroot/usr/include
+flags += -fmessage-length=0
+flags += -g0 -O2
+flags += -fvisibility=hidden
+
+flags += -idirafter icu/icuSources/common
+flags += -idirafter icu/icuSources/i18n
+
+flags += -Wall
+
+flags += -Wno-unknown-warning-option
+flags += -Wno-logical-op-parentheses
+flags += -Wno-dangling-else
+flags += -Wno-shift-op-parentheses
+flags += -Wno-deprecated-declarations
+
+xflags :=
+xflags += -fobjc-call-cxx-cdtors
+xflags += -fvisibility-inlines-hidden
+
+link += -Lsysroot/usr/lib
+link += -multiply_defined suppress
+
+libs += -framework CoreFoundation
+libs += -framework CoreGraphics
+libs += -framework Foundation
+libs += -framework GraphicsServices
+libs += -framework IOKit
+libs += -framework QuartzCore
+libs += -framework SpringBoardServices
+libs += -framework SystemConfiguration
+libs += -framework WebCore
+libs += -framework WebKit
+
+libs += -lapt-pkg
+libs += -licucore
+
+uikit :=
+uikit += -framework UIKit
+
+version := $(shell ./version.sh)
+
+cycc = $(gxx) -arch armv6 -o $@ -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks
+
+cycc += -marm # @synchronized
+cycc += -mcpu=arm1176jzf-s
+cycc += -mllvm -arm-reserve-r9
+link += -lgcc_s.1
+
+dirs := Menes CyteKit Cydia SDURLCache
+
+code := $(foreach dir,$(dirs),$(wildcard $(foreach ext,h hpp c cpp m mm,$(dir)/*.$(ext))))
+code := $(filter-out SDURLCache/SDURLCacheTests.m,$(code))
+code += MobileCydia.mm Version.mm iPhonePrivate.h Cytore.hpp lookup3.c Sources.h Sources.mm DiskUsage.cpp
+
+source := $(filter %.m,$(code)) $(filter %.mm,$(code))
+source += $(filter %.c,$(code)) $(filter %.cpp,$(code))
+header := $(filter %.h,$(code)) $(filter %.hpp,$(code))
+
+object := $(source)
+object := $(object:.c=.o)
+object := $(object:.cpp=.o)
+object := $(object:.m=.o)
+object := $(object:.mm=.o)
+object := $(object:%=Objects/%)
+
+images := $(shell find MobileCydia.app/ -type f -name '*.png')
+images := $(images:%=Images/%)
+
+lproj_deb := debs/cydia-lproj_$(version)_iphoneos-arm.deb
+
+all: MobileCydia