-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpxt.mk
More file actions
67 lines (56 loc) · 1.7 KB
/
pxt.mk
File metadata and controls
67 lines (56 loc) · 1.7 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
59
60
61
62
63
64
65
66
67
PXT_LIBRARIES := pxt pxt-common-packages pxt-steami pxt-steami-backend
PXT_INSTALL_LIBRARIES := $(addprefix install-,$(PXT_LIBRARIES))
PXT_COMMANDS := add buildcss buildjres buildsimjs buildsprites buildtarget bump checkdocs checkpkgcfg ci console deploy extract help init install npminstallnative run serve staticpkg tag testghpkgs update usedblocks
# Arguments par défaut pour chaque commande PXT
PXT_ADD_ARGS ?=
PXT_BUILDCSS_ARGS ?=
PXT_BUILDJRES_ARGS ?=
PXT_BUILDSIMJS_ARGS ?=
PXT_BUILDSPRITES_ARGS ?=
PXT_BUILDTARGET_ARGS ?= --localbuild --force
PXT_BUMP_ARGS ?=
PXT_CHECKDOCS_ARGS ?=
PXT_CHECKPKGCFG_ARGS ?=
PXT_CI_ARGS ?=
PXT_CONSOLE_ARGS ?=
PXT_DEPLOY_ARGS ?=
PXT_EXTRACT_ARGS ?=
PXT_HELP_ARGS ?=
PXT_INIT_ARGS ?=
PXT_INSTALL_ARGS ?=
PXT_NPMINSTALLNATIVE_ARGS ?=
PXT_RUN_ARGS ?=
PXT_SERVE_ARGS ?= --no-browser --no-serial -h '0.0.0.0'
PXT_STATICPKG_ARGS ?= -o ../static/ --localbuild
PXT_TAG_ARGS ?=
PXT_TESTGHPKGS_ARGS ?=
PXT_UPDATE_ARGS ?=
PXT_USEDBLOCKS_ARGS ?=
PXT="$(shell pwd)/node_modules/.bin/pxt"
define pxt_command
echo "PXT = $(PXT)"
echo "Call pxt $1"
if ! [ -x $(PXT) ]; then \
echo "pxt is not installed! Please run make setup first"; \
exit 1; \
fi
cd pxt-steami || exit 1
pxt $1
endef
define _call_pxt_command_template
.PHONY: $1
$1: $3
@$$(call pxt_command,$2 $$(PXT_$(shell echo $2 | tr '[:lower:]' '[:upper:]')_ARGS))
endef
# Install targets
define _install_node_package_template
.PHONY: install-$1
install-$1: $2/node_modules/.package-lock.json $2/package-lock.json
$2/node_modules/.package-lock.json $2/package-lock.json: $2/package.json
@$$(call install_node_package,$$(<D))
endef
define _build_pxt_core
@echo "Build pxt core"
cd pxt || exit
npm run build
endef