Merge pull request #26 from shtrom/makefile-fixes

Makefile fixes
This commit is contained in:
Thomas Vogt 2019-02-07 12:20:06 +01:00 committed by GitHub
commit a61e0fbd48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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_WIN_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 scripts executable
echo $@ | grep -vq '\(\.sh\|\.py\)$$' || chmod a+x $@
clean:
rm -rf $(TARGET_DIR)

View File

@ -46,16 +46,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 (i.e., replace `firefox` by `chrome`, `opera`, `chromium` or `vivaldi` if necessary):
Clone the repository. Then, run the following command.
```
$ cd ./src
$ make
$ cd ../bin/testing
$ ./install_host_app.sh --local firefox
$ 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 `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: