-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (96 loc) · 2.35 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
# vim: noexpandtab tabstop=8
#
# Configuration
#
# These are used to configure this DEXT build
#
# PREFIX used to customize the PROJECT_BUNDLE_IDENTIFIER
#
# IDVENDOR
# IDPRODUCT
# BCONFIGURATIONVALUE
# BINTERFACENUMBER
#
#
# Targets
#
# PROJECT_BUNDLE_IDENTIFIER return the customized value
#
# build build and codesign the DEXT
#
#
.PHONY: build
ifndef PREFIX
PREFIX = test
endif
ifndef IDVENDOR
IDVENDOR = 0x15ec
endif
ifndef IDPRODUCT
IDPRODUCT = 0xf101
endif
ifndef BCONFIGURATIONVALUE
BCONFIGURATIONVALUE = 0x1
endif
ifndef BINTERFACENUMBER
BINTERFACENUMBER = 0x0
endif
ifndef IOCLASS
IOCLASS = IOUserNetworkEthernet
endif
#ifndef IOCLASS
#IOCLASS = IOUserService
#endif
include Makefile.cfg
.PHONY: build Info.plist
all:
# definition of the PRODUCT_BUNDLE_IDENTIFIER
#PROJECT_BUNDLE_IDENTIFIER:
# @echo com.belcarra.${PREFIX}-MyUserUSBInterfaceDriver2
test:
@echo PREFIX: ${PREFIX}
@echo PROJECT_BUNDLE_IDENTIFIER: `make PROJECT_BUNDLE_IDENTIFIER`
@echo DEXTPATH: `make DEXTPATH`
@echo ENTITLEMENTS: `make ENTITLEMENTS`
build: clean Info.plist xcodebuild codesign
# Setup Info.plist, N.B. Additional values are set as part of xcodebuild,
# but these values are not supported from the project file, xcconfig or command line.
#
Info.plist: ./Info.plist.in
sed \
-e 's/_IDVENDOR_/${IDVENDOR}/' \
-e 's/_IDPRODUCT_/${IDPRODUCT}/' \
-e 's/_BCONFIGURATIONVALUE_/${BCONFIGURATIONVALUE}/' \
-e 's/_BINTERFACENUMBER_/${BINTERFACENUMBER}/' \
-e 's/_IOCLASS_/${IOCLASS}/' \
< $< > $@
# Build the project
xcodebuild:
xcodebuild \
-quiet \
INFOPLIST_FILE=Info.plist \
PRODUCT_BUNDLE_IDENTIFIER=`make PREFIX=${PREFIX} PROJECT_BUNDLE_IDENTIFIER` \
PROVISIONING_PROFILE_SPECIFIER=`make PREFIX=${PREFIX} PROVISIONING_PROFILE_SPECIFIER` \
-configuration Release SYMROOT="$(CURDIR)/build"
#TARGET_TEMP_DIR=tmp \
codesign:
../codesign-dext.sh ${PREFIX}
clean:
-rm -rf build tmp Info.plist
really-clean: clean
-rm -rf *.xcodeproj/*xcworkspace/
-rm -rf *.xcodeproj/*xcuserdata/
xcode:
open *.xcodeproj
open:
open build/Debug/USBApp.app
install:
rsync -a --delete build/Debug/USBApp.app /Applications
run: install
open /Applications/USBApp.app
list:
systemextensionsctl list
reset:
systemextensionsctl reset
log-show-extension-manager:
log show --predicate 'sender == "sysextd" or sender CONTAINS "sc.knight"' --info --debug --last 1h