-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (73 loc) · 2.99 KB
/
Makefile
File metadata and controls
102 lines (73 loc) · 2.99 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
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
.DEFAULT_GOAL = default
default : build
all : setup build
.ONESHELL: # Applies to every targets
include env.mk
include commons.mk
include pxt.mk
# Setup commands
.PHONY: prepare
prepare:
@echo "Install Git hooks"
git config core.hooksPath .hooks
.PHONY: setup
setup: deepclean $(PXT) $(PXT_INSTALL_LIBRARIES) build-pxt-core
@echo "Setup makecode-steami"
.PHONY : clean
clean : ;@$(call _clean)
.PHONY : clean-pxt-core
clean-pxt-core : ;@$(call _clean_pxt_core)
.PHONY : clean-pxt-common-packages
clean-pxt-common-packages : ;@$(call _clean_pxt_common_packages)
.PHONY : clean-local-certificates
clean-local-certificates : ;@$(call _clean_pxt_steami_backend_certificates)
.PHONY : deepclean
deepclean : ;@$(call _deepclean)
# Create make rule for each PXT command
$(foreach command,$(PXT_COMMANDS),$(eval $(call _call_pxt_command_template,$(command),$(command),$(PXT))))
# Create install rules for each pxt package
$(foreach target,$(PXT_LIBRARIES),$(eval $(call _install_node_package_template,$(target),$(target))))
.PHONY : install-makecode-steami
install-makecode-steami: node_modules/.package-lock.json package-lock.json
node_modules/.package-lock.json package-lock.json:
@$(call install_node_package,.)
# Install pxt CLI
$(PXT) : install-makecode-steami
.NOTPARALLEL : $(PXT) setup
# Build pxt cli
pxt/built/target.json : pxt/node_modules/.package-lock.json
@echo "Build pxt core"
@$(call _build_pxt_core)
.PHONY : build-pxt-core
build-pxt-core : install-pxt
@echo "Building pxt core ..."
$(call _build_pxt_core)
@echo "pxt core built"
# Create build rule by aliasing pxt buildtarget command
.PHONY : build
build : buildtarget
# Create package rule by aliasing pxt staticpkg command
.PHONY : package
package : staticpkg
static/target.json : staticpkg
.PHONY : staticserve
staticserve : static/target.json pxt-steami-backend/https/fastify.cert pxt-steami-backend/https/fastify.key pxt-steami-backend/node_modules/.package-lock.json
@echo "Serve static editor"
nodemon pxt-steami-backend/server.js
.PHONY : localcertificates
localcertificates: pxt-steami-backend/https/fastify.cert pxt-steami-backend/https/fastify.key pxt-steami-backend/https/rootCA.pem
.PHONY : install-cert-for-local-dev
install-cert-for-local-dev : localcertificates
@$(call _install_cert_for_local_dev)
pxt-steami-backend/https/fastify.cert pxt-steami-backend/https/fastify.key pxt-steami-backend/https/rootCA.pem & : ;@$(call _generate_localcertificates)
# A useful debug Make Target - found from
# http://lists.gnu.org/archive/html/help-make/2005-08/msg00137.html
.PHONY: printvars
printvars:
@$(foreach V,$(sort $(.VARIABLES)), \
$(if $(filter-out environment% default automatic, \
$(origin $V)),$(warning $V=$($V) ($(value $V)))))
# Affiche toutes les cibles disponibles dans le Makefile
.PHONY: list
list:
@LC_ALL=C $(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | grep -E -v -e '^[^[:alnum:]]' -e '^$@$$'