add Makefile

This commit is contained in:
matth@ultra 2024-09-01 17:44:31 +02:00
parent c06b80f204
commit ad2e45176a
2 changed files with 34 additions and 1 deletions

32
Makefile Normal file
View File

@ -0,0 +1,32 @@
TESTDIR = test
INSTALL_FLS = config.html config.js index.html index.js imgsort.php style.css
SRC_DIR = src
SASS_CMD = sass --color --load-path=src/sass
.PHONY: install start stop test php
install:
ifndef DEST
$(error Usage: `make install DEST=/installation/directory`)
endif
mkdir -p $(DEST)
install -m 0744 $(foreach f,$(INSTALL_FLS),$(SRC_DIR)/$(f)) $(DEST)
# testing
php:
php -S localhost:8000 -t . &
@# firefox http://localhost:8000/src/index.html
stop:
-killall php
# Compile the sass
css:
$(SASS_CMD) --no-indented src/sass/main.sass src/style.css
test:
-@rm -r $(TESTDIR)
-@mkdir -p $(TESTDIR) $(TESTDIR)/staging $(TESTDIR)/dest1 $(TESTDIR)/dest2 $(TESTDIR)/dest3
-@cp testres/* $(TESTDIR)/staging

View File

@ -17,7 +17,8 @@ The web interface has mobile optimizations, letting you sort images/files on the
## Installation ## Installation
You need a *php* enabled web server, for example *nginx* with *php-fpm*. You need a *php* enabled web server, for example *nginx* with *php-fpm*.
The web server needs to serve the app as well as the directory containg all images, called `rootDir`. To Install the app files in `/www/imgsort2`, use `make install DEST=/www/imgsort2`.
The web server needs to serve the app files as well as the directory containg all images, called `rootDir`.
You need to configure the `$rootDir` and `$rootPath` as well as the `$stagingDirName` accordingly in the `imgsort.php` file. You need to configure the `$rootDir` and `$rootPath` as well as the `$stagingDirName` accordingly in the `imgsort.php` file.
If you a using nextcloud, make sure to have the `rootDir` directory as an "external" storage media and not in the main nextcloud `data` directory. If you a using nextcloud, make sure to have the `rootDir` directory as an "external" storage media and not in the main nextcloud `data` directory.