Browse Source

Cleanup Makefile

Peter Justin 3 years ago
parent
commit
93add9a54b
1 changed files with 19 additions and 27 deletions
  1. 19 27
      Makefile

+ 19 - 27
Makefile

@@ -1,57 +1,49 @@
 .PHONY: clean install help test lint isort run dependencies docs wheel upload
+.DEFAULT_GOAL := help
+
+help: ## Displays this help message.
+	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
 
-help:
-	@echo "  clean      remove unwanted stuff"
-	@echo "  install    install dependencies and flaskbb"
-	@echo "  devconfig  generates a development config"
-	@echo "  test       run the testsuite"
-	@echo "  lint       check the source for style errors"
-	@echo "  isort      sort the python imports"
-	@echo "  run        run the development server with the development config"
-	@echo "  dist       creates distribution packages (bdist_wheel, sdist)"
-	@echo "  upload     uploads a new version of FlaskBB to PyPI"
-	@echo "  docs       build the documentation"
 
 dependencies:requirements.txt
 	@echo "Installing dependencies..."
 	@pip install -r requirements.txt 1>/dev/null
 
-clean:
+clean: ## Remove unwanted stuff such as __pycache__, etc...
 	find . -name '*.pyc' -exec rm -f {} +
 	find . -name '*.pyo' -exec rm -f {} +
 	find . -name '*~' -exec rm -f {} +
 	find . -name '__pycache__' -exec rm -rf {} +
 
-test:
+test: ## Runs the testsuite
 	tox
 
-run:
+run: ## Runs the development server with the development config
 	flaskbb run --debugger --reload
 
-devconfig:dependencies
+frontend: ## Runs the webpack server which watches for changes in flaskbb/themes/aurora
+	cd flaskbb/themes/aurora && npm run watch
+
+devconfig:dependencies ## Generates a development config
 	flaskbb makeconfig -d
 
-install:dependencies
+install:dependencies ## Installs the dependencies and FlaskBB
 	@[ -f ./flaskbb.cfg ] || (echo "flaskbb.cfg not found. You can generate a configuration file with 'flaskbb makeconfig'."; exit 1)
 	flaskbb --config ./flaskbb.cfg install
 
-docs:
+docs: ## Builds the Sphinx docs
 	$(MAKE) -C docs html
 
-lint:check-flake8
-	flake8
-
-check-flake8:
+lint: ## Checks the source for style errors
 	@type flake8 >/dev/null 2>&1 || echo "Flake8 is not installed. You can install it with 'pip install flake8'."
+	flake8
 
-isort:check-isort
-	isort --order-by-type -rc -up
-
-check-isort:
+isort:  ## Sorts the python imports
 	@type isort >/dev/null 2>&1 || echo "isort is not installed. You can install it with 'pip install isort'."
+	isort --order-by-type -rc -up
 
-dist:
+dist: ## Creates distribution packages (bdist_wheel, sdist)
 	python setup.py sdist bdist_wheel
 
-upload:dist
+upload:dist ## Uploads a new version of FlaskBB to PyPI
 	twine upload --skip-existing dist/*