-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
137 lines (113 loc) · 4.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Makefile for Apple SDK with Open Tool Chain Headers for firmware 2.0
PROJECTNAME = ScreenSplitr
APPFOLDER=$(PROJECTNAME).app
INSTALLFOLDER=$(PROJECTNAME).app
IPHONE_IP=192.168.1.45
SDKVER=2.0
DEV = /Developer/Platforms/iPhoneOS.platform/Developer
SDK = $(DEV)/SDKs/iPhoneOS3.0.sdk
CC = $(DEV)/usr/bin/gcc-4.0
LD = $(DEV)/usr/bin/g++-4.0
VERSION = iPhoneOS,$(SDKVER)
LDFLAGS = -arch armv6 -mmacosx-version-min=10.5 -Wl,-dead_strip -miphoneos-version-min=2.2 -undefined suppress -force_flat_namespace
LDFLAGS += -isysroot $(SDK)
LDFLAGS += -framework CoreFoundation
LDFLAGS += -framework Foundation
LDFLAGS += -framework UIKit
LDFLAGS += -framework IOKit
#LDFLAGS += -framework LayerKit
LDFLAGS += -framework CoreGraphics
LDFLAGS += -framework GraphicsServices
LDFLAGS += -framework CoreSurface
LDFLAGS += -framework CoreAudio
LDFLAGS += -framework Celestial
LDFLAGS += -framework AudioToolbox
LDFLAGS += -framework MediaPlayer
LDFLAGS += -framework QuartzCore
#LDFLAGS += -framework ImageIO
LDFLAGS += -L"$(SDK)/usr/lib"
LDFLAGS += -F"$(SDK)/System/Library/Frameworks"
LDFLAGS += -F"$(SDK)/System/Library/PrivateFrameworks"
CFLAGS = -arch armv6 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -mdynamic-no-pic -Wreturn-type -Wunused-variable -isysroot $(SDK) -fvisibility=hidden -fvisibility-inlines-hidden -gdwarf-2 -mthumb -miphoneos-version-min=2.2
CFLAGS += -I"$(SDK)/usr/include"
CFLAGS += -I"$(DEV)/usr/lib/gcc/arm-apple-darwin9/4.0.1/include"
CFLAGS += -F"$(SDK)/System/Library/PrivateFrameworks"
#CFLAGS += -DNPT_DEBUG -DNPT_CONFIG_ENABLE_LOGGING
BUILDDIR = ./build/3.0
SRCDIR = ./src
RESDIR = ./resources
OBJS = $(patsubst %.mm,%.o,$(wildcard $(SRCDIR)/*.mm))
OBJS += $(patsubst %.c,%.o,$(wildcard $(SRCDIR)/*.c))
# OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Platinum/Source/Core/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Platinum/Source/Devices/MediaServer/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Platinum/Source/Devices/FrameStreamer/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/Core/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/System/Bsd/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/System/Posix/*.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/System/StdC/NptStdcFile.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/System/StdC/NptStdcEnvironment.cpp))
OBJS += $(patsubst %.cpp,%.o,$(wildcard $(SRCDIR)/Neptune/Source/System/StdC/NptStdcDebug.cpp))
RESOURCES = $(wildcard $(RESDIR)/*)
CFLAGS += -I"$(SRCDIR)/Neptune/Source/Core"
CFLAGS += -I"$(SRCDIR)/Platinum/Source/Platinum"
CFLAGS += -I"$(SRCDIR)/Platinum/Source/Core"
CFLAGS += -I"$(SRCDIR)/Platinum/Source/Devices/MediaServer"
CFLAGS += -I"$(SRCDIR)/Platinum/Source/Devices/FrameStreamer"
#CPPFLAGS = $(CFLAGS)
CPPFLAGS = $(CFLAGS)
#CPPFLAGS += -pedantic
all: $(PROJECTNAME)
$(PROJECTNAME): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^
%.o: %.m
$(CC) -c $(CFLAGS) $< -o $@
%.o: %.mm
$(CC) -c -x objective-c++ $(CFLAGS) $< -o $@
%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
%.o: %.cpp
$(CC) -c -x c++ $(CFLAGS) $(CPPFLAGS) $< -o $@
dist: $(PROJECTNAME)
rm -rf $(BUILDDIR)
mkdir -p $(BUILDDIR)/$(APPFOLDER)
ifneq ($(RESOURCES),)
cp -r $(RESOURCES) $(BUILDDIR)/$(APPFOLDER)
find $(BUILDDIR) -type f -name .DS_Store -print0 | xargs -0 rm
find $(BUILDDIR) -name .svn -print0 | xargs -0 rm -rf
endif
cp Info.plist $(BUILDDIR)/$(APPFOLDER)/Info.plist
@echo "APPL????" > $(BUILDDIR)/$(APPFOLDER)/PkgInfo
ifneq ($(NIBS),)
mv $(NIBS) $(BUILDDIR)/$(APPFOLDER)
endif
export CODESIGN_ALLOCATE=$(DEV)/usr/bin/codesign_allocate; ./ldid_mac -S $(PROJECTNAME)
mv $(PROJECTNAME) $(BUILDDIR)/$(APPFOLDER)
install: dist
ping -t 3 -c 1 $(IPHONE_IP)
#ssh root@$(IPHONE_IP) 'killall ${PROJECTNAME} > /dev/null 2>&1'
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER)'
scp -r $(BUILDDIR)/$(APPFOLDER) root@$(IPHONE_IP):/Applications/$(INSTALLFOLDER)
@echo "Application $(INSTALLFOLDER) installed, please respring iPhone"
#ssh root@$(IPHONE_IP) 'ldid -S /Applications/$(INSTALLFOLDER)/ScreenSplitr;restart'
ssh root@$(IPHONE_IP) 'restart'
package: dist
./package.sh
deploy: package
scp package/Packages.bz2 [email protected]:~/plutinosoft.com/cydia
scp -r package/deb [email protected]:~/plutinosoft.com/cydia
uninstall:
ping -t 3 -c 1 $(IPHONE_IP)
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER); restart'
@echo "Application $(INSTALLFOLDER) uninstalled, please respring iPhone"
install_respring:
ping -t 3 -c 1 $(IPHONE_IP)
scp respring root@$(IPHONE_IP):/usr/bin/respring
install_restart:
ping -t 3 -c 1 $(IPHONE_IP)
scp restart root@$(IPHONE_IP):/usr/bin/restart
clean:
@find src -type f -name *.o | xargs rm
@find src -type f -name *.gch | xargs rm
@rm -rf $(BUILDDIR)
@rm -f $(ZIPNAME)