diff --git a/src/Makefile b/Makefile similarity index 70% rename from src/Makefile rename to Makefile index ef32226..5a699d3 100644 --- a/src/Makefile +++ b/Makefile @@ -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) diff --git a/README.md b/README.md index 9da928b..b0b6454 100644 --- a/README.md +++ b/README.md @@ -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: