diff --git a/packages/xsnap/makefiles/lin/xsnap.mk b/packages/xsnap/makefiles/lin/xsnap.mk index 55036107da9..ad3d20f580e 100644 --- a/packages/xsnap/makefiles/lin/xsnap.mk +++ b/packages/xsnap/makefiles/lin/xsnap.mk @@ -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 @@ -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) diff --git a/packages/xsnap/makefiles/mac/xsnap.mk b/packages/xsnap/makefiles/mac/xsnap.mk index 6a4a35876eb..bb77735d16f 100644 --- a/packages/xsnap/makefiles/mac/xsnap.mk +++ b/packages/xsnap/makefiles/mac/xsnap.mk @@ -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 @@ -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) diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index f72be34958e..6d0754830cc 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -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'",