-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (51 loc) · 1.63 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
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright 2022 Joyent, Inc.
# Copyright 2023 MNX Cloud, Inc.
#
#
# sdcnode makefile
#
HOST_IMAGE=$(shell pfexec mdata-get sdc:image_uuid)
# Use HOST_IMAGE as the $(NAME) so that we can reuse eng.git's bits-upload
NAME=$(HOST_IMAGE)
ENGBLD_REQUIRE := $(shell git submodule update --init deps/eng)
include ./deps/eng/tools/mk/Makefile.defs
# 21.4.0 images moved the MIN_PLATFORM up, so override the default
# build values if necessary. We need a more elegant way to do this
# when we start using images later than 21.4.0, and this should
# probably be in the previously included Makefile.defs anyway.
ifeq ($(shell $(_AWK) '/^Image/ {print $$3}' < /etc/product),21.4.0)
BASE_IMAGE_UUID = a7199134-7e94-11ec-be67-db6f482136c2
BUILD_PLATFORM = 20210826T002459Z
endif
#
# Files
#
CLEAN_FILES += build/nodes bits
DISTCLEAN_FILES += build
ENGBLD_DEST_OUT_PATH ?= /public/releng/sdcnode
#
# Repo-specific targets
#
.PHONY: all
all: build/src nodes publish
build/src:
git clone https://github.com/nodejs/node.git build/src
.PHONY: nodesrc
nodesrc: | build/src
cd build/src && git checkout main \
&& git fetch origin && git pull --rebase origin main
.PHONY: nodes
nodes: nodesrc
./tools/build-all-nodes $(TOP)/build/nodes $(STAMP) "this.image=='$(HOST_IMAGE)'"
.PHONY: publish
publish: prepublish
rm -rf $(TOP)/bits/sdcnode
mkdir -p $(TOP)/bits/sdcnode
cp $(TOP)/build/nodes/*/sdcnode-*.tgz $(TOP)/bits/sdcnode
include ./deps/eng/tools/mk/Makefile.targ