diff --git a/Makefile b/Makefile index 8db0bd1..b938c0f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,13 @@ STAGING_DIR = .sort # INSTALL_DIR = + + # DO NOT CHANGE ANYTHING HERE +default: css +.PHONY: clean install stop test php css + +# Installation ifndef ROOT_DIR $(error Edit this Makefile and set the ROOT_DIR variable) endif @@ -32,20 +38,18 @@ $(error Edit this Makefile and set the ROOT_PATH variable) endif SRC_DIR = src -_SRC_FLS = config.html config.js index.html index.js imgsort.php style.css +_SRC_FLS = config.html config.js index.html index.js imgsort.php style.css style.css.map SRC_FLS = $(foreach f,$(_SRC_FLS),$(SRC_DIR)/$(f)) INSTALL_FLS = $(foreach f,$(_SRC_FLS),$(INSTALL_DIR)/$(f)) SASS_CMD = sass --color --load-path=src/sass -default: css -.PHONY: clean install stop test php css install: $(INSTALL_FLS) imgsort2-nginx.conf imgsort2-php-fpm.conf $(INSTALL_DIR)/%.php: $(SRC_DIR)/%.php - sed 's|$$rootDir = .*|$$rootDir = "$(ROOT_DIR)/";|; s|$$rootPath = .*|$$rootPath = "$(ROOT_PATH)/"|; s|$$stagingDirName = .*|$$stagingDirName = "$(STAGING_DIR)/";|' $< > $@ + sed 's|$$rootDir = .*|$$rootDir = "$(ROOT_DIR)/";|; s|$$rootPath = .*|$$rootPath = "$(ROOT_PATH)/";|; s|$$stagingDirName = .*|$$stagingDirName = "$(STAGING_DIR)/";|' $< > $@ chmod 0744 $@ $(INSTALL_DIR)/%: $(SRC_DIR)/% @@ -58,19 +62,16 @@ $(INSTALL_DIR)/%: $(SRC_DIR)/% clean: rm $(INSTALL_FLS) - - -# testing +# Compile the sass +css: + $(SASS_CMD) --no-indented --no-source-map src/sass/main.sass src/style.css +# 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 - TESTDIR = images # Create a image directory for testing. @@ -79,3 +80,4 @@ test: -@rm -r $(TESTDIR) -@mkdir -p $(TESTDIR) $(TESTDIR)/.sort -@cp resources/* $(TESTDIR)/.sort + diff --git a/src/config.html b/src/config.html index 86a288f..9ee97e5 100644 --- a/src/config.html +++ b/src/config.html @@ -9,14 +9,14 @@