-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathcollect-deps-makefile
85 lines (64 loc) · 2.36 KB
/
collect-deps-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
include RID.opt
include ../shared/GdalCore.opt
ifeq ($(RID),)
RID=osx-arm64
endif
BUILD_BASE_LIB=$(GDAL_BUILD)/lib
SHELL=/bin/bash
BINDINGS_SOURCE=$(BUILD_ROOT)/gdal-cmake-temp/swig/csharp
# output helper
define \n
endef
all: build
OUTPUT = $(PACKAGE_BUILD_ROOT)/runtimes/$(RID)/native
BUILD_BASE = $(BASE)/bindings
WRAP_TARGETS = $(wildcard $(BINDINGS_SOURCE)/lib*.dylib)
echo-targets: $(WRAP_TARGETS)
WRAP_TARGETS_1=$(addprefix -x , $(notdir $(WRAP_TARGETS)))
@echo $(WRAP_TARGETS_1)
.PHONY: force
$(WRAP_TARGETS): force
@echo $(@F)
build: linkall
@echo "Bindings and drivers are ready to packaging!"
$(MAKE) -f gdal-makefile formats-output
linkall: initdirs copy-projdb collect-bindings copy-deps
@echo "Libraries patched successfully"
clean:
(cd $(BUILD_BASE) && rm -f ${CSHARP_MODULES} *.$(OBJ_EXT) *.config *.dll *.mdb *.exe)
(cd $(PWD) && rm -f ${CSHARP_MODULES} *.$(OBJ_EXT) *.config *.dll *.mdb *.exe)
cleanpackages:
@if [ -d "$(NUGET_)" ]; then rm -rf "$(NUGET_)"; fi;
initdirs:
rm -rvf $(OUTPUT)/*.*
mkdir -p $(OUTPUT)
mkdir -p $(NUGET_)
collect-bindings:
# copy generatated c# sources to project directory
# to make them available for windows package build
@if [ ! -d "$(BUILD_BASE)" ]; then mkdir "$(BUILD_BASE)"; fi;
mkdir -p $(BUILD_BASE)/const/ && cp -fRL $(BINDINGS_SOURCE)/const/*.cs $(BUILD_BASE)/const/
mkdir -p $(BUILD_BASE)/gdal/ && cp -fRL $(BINDINGS_SOURCE)/gdal/*.cs $(BUILD_BASE)/gdal/
mkdir -p $(BUILD_BASE)/osr/ && cp -fRL $(BINDINGS_SOURCE)/osr/*.cs $(BUILD_BASE)/osr/
mkdir -p $(BUILD_BASE)/ogr/ && cp -fRL $(BINDINGS_SOURCE)/ogr/*.cs $(BUILD_BASE)/ogr/
copy-deps:
# including all deps installed in this repo
# and some external dependencies
# 1. copy gdal.dylib.XX
# 2. get deps inlcuding PROJ and LD_LIBRARY_PATH
# 3. copy to output
cp -rfL $(BINDINGS_SOURCE)/*.dylib $(OUTPUT)/
dylibbundler -b \
$(addprefix -x , $(addprefix $(OUTPUT)/,$(notdir $(WRAP_TARGETS)))) \
-s ${VCPKG_INSTALLED_DYNAMIC}/lib \
-s $(GDAL_BUILD)/lib \
-s $(PROJ_BUILD)/lib \
-s $(HDF_BUILD)/lib \
-cd -d $(OUTPUT)/ -p "@loader_path/"
copy-projdb:
-mkdir -p $(LIBSHARED)
cp -rf $(PROJ_BUILD)/share/proj/proj.db $(LIBSHARED)
.EXPORT_ALL_VARIABLES:
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$(VCPKG_INSTALLED_DYNAMIC)/lib/pkgconfig
LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:${VCPKG_INSTALLED_DYNAMIC}/lib
DYLD_LIBRARY_PATH=$$DYLD_LIBRARY_PATH:${VCPKG_INSTALLED_DYNAMIC}/lib