-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (49 loc) · 1.65 KB
/
Makefile
File metadata and controls
58 lines (49 loc) · 1.65 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
BUILD_ROOT_PATH = build
OUTPUT_PATH = output
OUTPUT_LIBS_PATH = $(OUTPUT_PATH)/libs
OUTPUT_HEADERS_PATH = $(OUTPUT_PATH)/headers
BUILD_DEPS += Makefile
BUILD_DEPS += CMakeLists.txt
IOS_XCODEBUILD_LIB_DEVICE = xcodebuild \
-target cdps \
-arch arm64 \
-configuration Release \
-sdk iphoneos \
IOS_XCODEBUILD_LIB_SIMULATOR = xcodebuild \
-target cdps \
-arch x86_64 \
-configuration Release \
-sdk iphonesimulator \
IOS_LIB_COMBINE_PATH = $(BUILD_ROOT_PATH)/combine/ios
$(IOS_LIB_COMBINE_PATH): $(BUILD_DEPS)
mkdir -p $(IOS_LIB_COMBINE_PATH)
cd $(IOS_LIB_COMBINE_PATH) && (cmake -G Xcode ../../../ \
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
)
.PHONY: ios-lib-combine
ios-lib-combine: $(IOS_LIB_COMBINE_PATH)
set -o pipefail && cd $(IOS_LIB_COMBINE_PATH) && $(IOS_XCODEBUILD_LIB_DEVICE) && $(IOS_XCODEBUILD_LIB_SIMULATOR)
mkdir -p $(OUTPUT_LIBS_PATH) && mkdir -p $(OUTPUT_HEADERS_PATH) && (lipo -create \
$(IOS_LIB_COMBINE_PATH)/src/cdps/Release-iphoneos/libcdps.a \
$(IOS_LIB_COMBINE_PATH)/src/cdps/Release-iphonesimulator/libcdps.a \
-output $(OUTPUT_LIBS_PATH)/libcdps.a \
&& cp src/cdps/*.h $(OUTPUT_HEADERS_PATH) \
&& lipo -info $(OUTPUT_LIBS_PATH)/libcdps.a \
)
IOS_PROJ_PATH = $(BUILD_ROOT_PATH)/ios
.PHONY: iproj
iproj: git-hooks-config
mkdir -p $(IOS_PROJ_PATH)
cd $(IOS_PROJ_PATH) && cmake -G Xcode ../../ && open cdps.xcodeproj
.PHONY: git-hooks-config
git-hooks-config:
git config core.hooksPath .git-hooks
chmod +x .git-hooks/*
.PHONY: clean
clean:
rm -rf $(BUILD_ROOT_PATH)
rm -rf $(OUTPUT_PATH)
.PHONY: format
format:
find ./src -iname "*.h" -or -iname "*.hpp" -or -iname "*.cpp" | xargs clang-format -i