forked from AdaCore/ada_language_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (70 loc) · 2.27 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
# Server executable file:
export ALS=$(shell pwd)/.obj/server/ada_language_server
# Tester files
TESTER=$(shell pwd)/.obj/tester/tester-run
CODEC_TEST=.obj/codec_test/codec_test
# Testsuite directory
TD=testsuite/ada_lsp
GPRBUILD=gprbuild -j0
# Installation directory
DESTDIR=
# Library type
LIBRARY_TYPE=relocatable
# Build mode (dev or prod)
BUILD_MODE=dev
# Target platform as nodejs reports it
ifeq ($(OS),Windows_NT)
PLATFORM=win32
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PLATFORM=linux
endif
ifeq ($(UNAME_S),Darwin)
PLATFORM=darwin
endif
endif
ifeq ($(LIBRARY_TYPE), static)
LIBRARY_FLAGS=-XBUILD_MODE=$(BUILD_MODE) \
-XLIBRARY_TYPE=static \
-XXMLADA_BUILD=static \
-XGPR_BUILD=static
else
LIBRARY_FLAGS=-XBUILD_MODE=$(BUILD_MODE)
endif
all:
$(GPRBUILD) -P gnat/lsp.gpr -p $(LIBRARY_FLAGS)
$(GPRBUILD) -P gnat/lsp_server.gpr -p $(LIBRARY_FLAGS)
$(GPRBUILD) -P gnat/lsp_client.gpr -p $(LIBRARY_FLAGS)
$(GPRBUILD) -P gnat/spawn_tests.gpr -p $(LIBRARY_FLAGS)
$(GPRBUILD) -P gnat/tester.gpr -p $(LIBRARY_FLAGS)
$(GPRBUILD) -P gnat/codec_test.gpr -p $(LIBRARY_FLAGS)
mkdir -p integration/vscode/ada/$(PLATFORM)
cp -f .obj/server/ada_language_server integration/vscode/ada/$(PLATFORM) ||\
cp -f .obj/server/ada_language_server.exe integration/vscode/ada/$(PLATFORM)
generate:
python scripts/generate.py
install:
gprinstall -f -P gnat/lsp_server.gpr -p -r --prefix=$(DESTDIR) $(LIBRARY_FLAGS)
gprinstall -f -P gnat/tester.gpr -p --prefix=$(DESTDIR) $(LIBRARY_FLAGS)
gprinstall -f -P gnat/codec_test.gpr -p --prefix=$(DESTDIR) $(LIBRARY_FLAGS)
clean:
gprclean -P gnat/lsp.gpr $(LIBRARY_FLAGS)
gprclean -P gnat/lsp_server.gpr $(LIBRARY_FLAGS)
gprclean -P gnat/spawn_tests.gpr $(LIBRARY_FLAGS)
gprclean -P gnat/tester.gpr $(LIBRARY_FLAGS)
gprclean -P gnat/codec_test.gpr $(LIBRARY_FLAGS)
rm -rf integration/vscode/ada/$(PLATFORM)
vscode:
cd integration/vscode/ada; npm install
@echo Now run:
@echo code --extensionDevelopmentPath=`pwd`/integration/vscode/ada/ `pwd`
check: all
set -e; \
for a in $(TD)/*/*.json; do \
echo $$a ; \
(cd `dirname $$a ` ; $(TESTER) `basename $$a`) ;\
done
${CODEC_TEST} < testsuite/codecs/index.txt
deploy: check
integration/$(USER)/deploy.sh $(PLATFORM)