Skip to content

Commit a61e0fb

Browse files
authored
Merge pull request #26 from shtrom/makefile-fixes
Makefile fixes
2 parents 4e74463 + 0159523 commit a61e0fb

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

src/Makefile renamed to Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

2-
VERSION := testing
2+
VERSION ?= testing
3+
BROWSER ?= firefox
34

4-
SRC_DIR := .
5-
TARGET_DIR := ../bin/$(VERSION)
5+
SRC_DIR := ./src
6+
TARGET_DIR := ./bin/$(VERSION)
67

78
INSTALL_WIN_FILE := install_host_app.bat
89
INSTALL_WIN_SRC := $(SRC_DIR)/$(INSTALL_WIN_FILE)
@@ -20,12 +21,20 @@ HOST_TARGETS := $(INSTALL_WIN_TARGET) $(INSTALL_UNIX_TARGET) $(HOST_APP_TARGET)
2021

2122
all: $(HOST_TARGETS)
2223

24+
install: install-unix
25+
install-unix: $(HOST_TARGETS)
26+
$(INSTALL_UNIX_TARGET) --local $(BROWSER)
27+
install-win: $(HOST_TARGETS)
28+
$(INSTALL_WIN_TARGET) --local $(BROWSER)
29+
2330
%/.d:
2431
mkdir -p $(@D)
2532
@touch $@
2633

2734
$(HOST_TARGETS): $(TARGET_DIR)/%: $(SRC_DIR)/% $(TARGET_DIR)/.d
2835
sed -e "s/_VERSIONHOLDER_/$(VERSION)/g" < $(SRC_DIR)/$* > $@
36+
# Make scripts executable
37+
echo $@ | grep -vq '\(\.sh\|\.py\)$$' || chmod a+x $@
2938

3039
clean:
3140
rm -rf $(TARGET_DIR)

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,15 @@ Note: Older Windows versions might require powershell to be installed manually a
4646
#### Latest from GitHub
4747
This is not recommended! Only for developers and for testing purposes!
4848

49-
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):
49+
Clone the repository. Then, run the following command.
5050

5151
```
52-
$ cd ./src
53-
$ make
54-
$ cd ../bin/testing
55-
$ ./install_host_app.sh --local firefox
52+
$ make [VERSION=testing|...] [BROWSER=firefox|chrome|opera|chromium|vivaldi] install
5653
```
5754

58-
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.
55+
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).
56+
57+
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.
5958

6059
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:
6160

0 commit comments

Comments
 (0)