Skip to content

Commit

Permalink
fix(xsnap): Update submodules for build and use CURDIR (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal authored Jan 12, 2021
1 parent 36c98d8 commit d0bf5cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
17 changes: 3 additions & 14 deletions packages/xsnap/makefiles/lin/xsnap.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ ifneq ($(VERBOSE),1)
MAKEFLAGS += --silent
endif

# This Makefile gets invoked as "make" with this directory as the "cwd" using
# Node.js child_process.spawn. For reasons that remain mysterious to this
# author, under these circumstances, $(PWD) is two parent directories up
# from this file. At the shell, (cd makefiles/lin && make) works fine.
# Regardless, using HERE instead of PWD makes this Makefile work regardless of
# the working directory.
HERE = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
MODDABLE = $(HERE)/../../moddable
MODDABLE = $(CURDIR)/../../moddable
XS_DIR = $(MODDABLE)/xs
BUILD_DIR = $(HERE)/../../build
BUILD_DIR = $(CURDIR)/../../build

BIN_DIR = $(BUILD_DIR)/bin/lin/$(GOAL)
INC_DIR = $(XS_DIR)/includes
Expand Down Expand Up @@ -106,11 +99,7 @@ OBJECTS = \

VPATH += $(SRC_DIR) $(TLS_DIR)

build: $(MODDABLE)/README.md $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)

$(MODDABLE)/README.md:
git submodule init
git submodule update
build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)

$(TMP_DIR):
mkdir -p $(TMP_DIR)
Expand Down
17 changes: 3 additions & 14 deletions packages/xsnap/makefiles/mac/xsnap.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ ifneq ($(VERBOSE),1)
MAKEFLAGS += --silent
endif

# This Makefile gets invoked as "make" with this directory as the "cwd" using
# Node.js child_process.spawn. For reasons that remain mysterious to this
# author, under these circumstances, $(PWD) is two parent directories up
# from this file. At the shell, (cd makefiles/lin && make) works fine.
# Regardless, using HERE instead of PWD makes this Makefile work regardless of
# the working directory.
HERE = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
MODDABLE = $(HERE)/../../moddable
MODDABLE = $(CURDIR)/../../moddable
XS_DIR = $(MODDABLE)/xs
BUILD_DIR = $(HERE)/../../build
BUILD_DIR = $(CURDIR)/../../build

BIN_DIR = $(BUILD_DIR)/bin/mac/$(GOAL)
INC_DIR = $(XS_DIR)/includes
Expand Down Expand Up @@ -115,11 +108,7 @@ OBJECTS = \

VPATH += $(SRC_DIR) $(TLS_DIR)

build: $(MODDABLE)/README.md $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)

$(MODDABLE)/README.md:
git submodule init
git submodule update
build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)

$(TMP_DIR):
mkdir -p $(TMP_DIR)
Expand Down
2 changes: 1 addition & 1 deletion packages/xsnap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"main": "./src/xsnap.js",
"scripts": {
"build": "node -r esm src/build.js",
"build": "git submodule update --init && node -r esm src/build.js",
"clean": "rm -rf build",
"lint": "yarn lint:js && yarn lint:types",
"lint:js": "eslint 'src/**/*.js'",
Expand Down

0 comments on commit d0bf5cb

Please sign in to comment.