Makefile fixes

* Move to the root of the repo
* Make the install script executable
* Add install targets to the Makefile (defaults to install-unix,
	install-windows not actually tested)
* Update doc

Signed-off-by: Olivier Mehani <olivier.mehani@learnosity.com>
This commit is contained in:
Olivier Mehani 2018-08-23 14:28:24 +10:00
parent 0982aeaf96
commit e495e11e3b
No known key found for this signature in database
GPG Key ID: E9566B9D0957D2D3
2 changed files with 17 additions and 9 deletions

View File

@ -1,8 +1,9 @@
VERSION := testing
VERSION ?= testing
BROWSER ?= firefox
SRC_DIR := .
TARGET_DIR := ../bin/$(VERSION)
SRC_DIR := ./src
TARGET_DIR := ./bin/$(VERSION)
INSTALL_WIN_FILE := install_host_app.bat
INSTALL_WIN_SRC := $(SRC_DIR)/$(INSTALL_WIN_FILE)
@ -20,12 +21,20 @@ HOST_TARGETS := $(INSTALL_WIN_TARGET) $(INSTALL_UNIX_TARGET) $(HOST_APP_TARGET)
all: $(HOST_TARGETS)
install: install-unix
install-unix: $(HOST_TARGETS)
$(INSTALL_UNIX_TARGET) --local $(BROWSER)
install-win: $(HOST_TARGETS)
$(INSTALL_UNIX_TARGET) --local $(BROWSER)
%/.d:
mkdir -p $(@D)
@touch $@
$(HOST_TARGETS): $(TARGET_DIR)/%: $(SRC_DIR)/% $(TARGET_DIR)/.d
sed -e "s/_VERSIONHOLDER_/$(VERSION)/g" < $(SRC_DIR)/$* > $@
# Make install script executable
echo $@ | grep -vq '.sh$$' || chmod a+x $@
clean:
rm -rf $(TARGET_DIR)

View File

@ -44,16 +44,15 @@ Note: Older Windows versions might require powershell to be installed manually a
#### Latest from GitHub
This is not recommended! Only for developers and for testing purposes!
Clone the repository. Then, from the project's `src/` directory, run `make` and execute the installation script in `bin/testing` for your desired browser (`firefox`, `chrome`, `opera`, `chromium`, or `vivaldi`):
Clone the repository. Then, run the following command.
```
$ cd ./src
$ make
$ cd ../bin/testing
$ ./install_host_app.sh --local [firefox|chrome|opera|chromium|vivaldi]
$ make [VERSION=testing|...] [BROWSER=firefox|chrome|opera|chromium|vivaldi] install
```
This will copy the host application and manifest files to the right place for your browser. The `--local` option makes the script use the files on disk rather than downloading them from GitHub.
This will generate the host application and installation scripts for the given `VERSION` (`testing` by default), and copy the host application and manifest files to the right place for your `BROWSER` (`firefox` by default).
This uses the `--local` option of the the `install_host_app.sh` script, which instructs it to use the files on disk rather than downloading them from GitHub.
If this doesn't work, you can link the files yourself. First, change the `path` value in the `passff.json` file to be the absolute path to the project's `bin/testing/passff.py` file. Then symlink (or copy) the file `bin/testing/passff.json` to the appropriate location for your browser and OS: