forked from kyawlynn/goagent-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (47 loc) · 1.43 KB
/
Copy pathMakefile
File metadata and controls
58 lines (47 loc) · 1.43 KB
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
DEVICE_IP=$(THEOS_DEVICE_IP)
DEVICE_IP?=192.168.1.13
APPS = goagent-ios
PKG_ROOT = package
APP_ROOT = $(PKG_ROOT)/Applications/goagent-ios.app
OUTPUT = output
PLIST_BUDDY = /usr/libexec/PlistBuddy
VERSION = $(shell grep Version $(PKG_ROOT)/DEBIAN/control | cut -d ":" -f2 | tr -d " ")
DEB_NAME = $(DEB_ID)_$(VERSION)_iphoneos-arm.deb
DEB_ID = org.goagent.local.ios
.PHONY : $(APPS)
all: build_apps
build_apps:
@for i in $(APPS) ; do \
echo "building [$$i]" ; \
make -C $$i || exit 1; \
done
install: all
@for i in $(APPS) ; do \
echo "install [$$i] to $(PKG_ROOT) dir" ; \
make -C $$i custom-install || exit 1; \
done
package: install
@echo "*** packaging $(DEB_NAME)"
rm -Rf $(OUTPUT)/*.deb
$(PLIST_BUDDY) -c "Set :CFBundleShortVersionString $(VERSION)" $(APP_ROOT)/Info.plist
@if [ ! -e $(APP_ROOT)/goagent-ios_ ]; \
then \
mv $(APP_ROOT)/goagent-ios $(APP_ROOT)/goagent-ios_ ; \
mv $(APP_ROOT)/goagent $(APP_ROOT)/goagent-ios ; \
fi;
extra/dpkg-deb -b $(PKG_ROOT) $(OUTPUT)/$(DEB_NAME)
@echo "packaging done"
deploy:
@#ssh -p 22 root\@$(DEVICE_IP) "dpkg -r $(DEB_ID)" ;
scp $(OUTPUT)/$(DEB_NAME) root\@$(DEVICE_IP):~/; \
ssh -p 22 root\@$(DEVICE_IP) "dpkg -i ~/$(DEB_NAME)" ; \
clean:
@for i in $(APPS) ; do \
echo "cleaning $$i" ; \
make -C $$i clean || exit 1; \
rm -rf $$PRJDIR/build ; \
done
echo "cleaning $(PKG_ROOT)"
rm -Rf $(PKG_ROOT)/Applications
rm -Rf $(PKG_ROOT)/Library
rm -Rf $(OUTPUT)/*.deb