forked from ONLYOFFICE/DocumentBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
128 lines (103 loc) · 3.97 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
OUTPUT := ./
CURL := curl -L -o
COMPANY_NAME ?= onlyoffice
PRODUCT_NAME ?= documentbuilder
PRODUCT_VERSION ?= 0.0.0
PACKAGE_EDITION ?= normal
ifeq ($(OS),Windows_NT)
PLATFORM := win
EXEC_EXT := .exe
SCRIPT_EXT := .bat
SHARED_EXT := .dll
DEST_DIR ?= $(COMPANY_NAME)/$(PRODUCT_NAME)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PLATFORM := linux
SCRIPT_EXT := .sh
SHARED_EXT := .so*
LIB_PREFFIX := lib
DEST_DIR ?= /opt/$(COMPANY_NAME)/$(PRODUCT_NAME)
endif
endif
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),x86_64)
ARCHITECTURE := 64
endif
ifneq ($(filter %86,$(UNAME_M)),)
ARCHITECTURE := 32
endif
TARGET := $(PLATFORM)_$(ARCHITECTURE)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)graphics$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)kernel$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)DjVuFile$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)doctrenderer$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)HtmlFile$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)HtmlRenderer$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)PdfReader$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)PdfWriter$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)XpsFile$(SHARED_EXT)
BINARY_FILES += core/build/lib/$(TARGET)/$(LIB_PREFFIX)UnicodeConverter$(SHARED_EXT)
ifeq ($(PLATFORM),linux)
BINARY_FILES += core/Common/3dParty/icu/$(TARGET)/build/libicudata$(SHARED_EXT)
BINARY_FILES += core/Common/3dParty/icu/$(TARGET)/build/libicuuc$(SHARED_EXT)
endif
ifeq ($(PLATFORM),win)
BINARY_FILES += core/Common/3dParty/icu/$(TARGET)/build/icudt*$(SHARED_EXT)
BINARY_FILES += core/Common/3dParty/icu/$(TARGET)/build/icuuc*$(SHARED_EXT)
BINARY_FILES += core/Common/3dParty/v8/v8/out.gn/$(TARGET)/release/icudtl.dat
endif
BINARY_FILES += core/build/bin/$(TARGET)/x2t$(EXEC_EXT)
BINARY_FILES += core/build/bin/$(TARGET)/docbuilder$(EXEC_EXT)
BINARY_FILES += DoctRenderer.config
BINARY_FILES += samples$(SCRIPT_EXT)
HTML_FILE_INTERNAL := HtmlFileInternal
HTML_FILE_INTERNAL_FILES += core/build/lib/$(TARGET)/HtmlFileInternal$(EXEC_EXT)
HTML_FILE_INTERNAL_FILES += core/Common/3dParty/cef/$(TARGET)/build/**
FOLDERS += web-apps/deploy/sdkjs
FOLDERS += empty
FOLDERS += samples
JQUERY += web-apps/deploy/web-apps/vendor/jquery
XREGEXP += web-apps/deploy/web-apps/vendor/xregexp
#TODO REFACTORING FILE PATH
INCLUDE_FILES += core/DesktopEditor/doctrenderer/docbuilder.h
INCLUDE_FILES += core/DesktopEditor/common/base_export.h
DOCBUILDER_COM := core/build/lib/$(TARGET)/docbuilder.com.dll
DOCBUILDER_NET := core/build/lib/$(TARGET)/docbuilder.net.dll
.PHONY: all install uninstall
$(DOCBUILDER_COM):
$(CURL) $(DOCBUILDER_COM) http://d2ettrnqo7v976.cloudfront.net/wrappers/$(TARGET)/docbuilder.com.dll
$(DOCBUILDER_NET):
$(CURL) $(DOCBUILDER_NET) http://d2ettrnqo7v976.cloudfront.net/wrappers/$(TARGET)/docbuilder.net.dll
all:
cd core/Common/3dParty/ && ./make.sh
cd core && $(MAKE) all ext
cd sdkjs && $(MAKE)
clean:
cd core && $(MAKE) clean
cd core-ext && $(MAKE) clean
cd sdkjs && $(MAKE) clean
install: $(DOCBUILDER_COM) $(DOCBUILDER_NET)
mkdir -p $(DEST_DIR)
cp -t $(DEST_DIR) $(BINARY_FILES)
ifneq ($(PLATFORM),mac)
mkdir -p $(DEST_DIR)/$(HTML_FILE_INTERNAL)
cp -r -t $(DEST_DIR)/$(HTML_FILE_INTERNAL) $(HTML_FILE_INTERNAL_FILES)
endif
cp -r -t $(DEST_DIR) $(FOLDERS)
mkdir -p $(DEST_DIR)/sdkjs/vendor
cp -r -t $(DEST_DIR)/sdkjs/vendor $(JQUERY) $(XREGEXP)
mkdir -p $(DEST_DIR)/include
cp -t $(DEST_DIR)/include $(INCLUDE_FILES)
ifeq ($(PLATFORM),win)
mkdir -p $(DEST_DIR)/wrappers
cp -t $(DEST_DIR)/wrappers $(DOCBUILDER_COM) $(DOCBUILDER_NET)
endif
ifeq ($(PACKAGE_EDITION),portable)
for i in $(DEST_DIR)/*; do \
./dependencies.sh $${i} $(DEST_DIR)/system ; \
done
cd $(DEST_DIR) && patchelf --set-interpreter ./system/ld-linux-x86-64.so.2 ./x2t
endif
uninstall:
rm -fr $(DEST_DIR)