From 3d4c5cdde0008d6b1810587f5fa8d262249a32eb Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 1 Mar 2024 18:46:27 +0000 Subject: [PATCH] Entrypoint Makefile for running application commands --- Makefile | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dd336d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,60 @@ + +######################################################################### +# Welcome to Awesome Privacy! # +# This file contains all the commands for the project (in lib and web) # +# # +# lib commands: # +# make install_lib_deps - Install Python dependencies for lib/ # +# make validate - Validates awesome-privacy.yml against the schema # +# make gen_readme - Generate README.md from awesome-privacy.yml # +# # +# web commands: # +# make install_web_deps - Install NPM dependencies for the website # +# make build_web - Build the static website (outputs to web/dist/) # +# make start_web - Starts a webserver to serve the static website # +# # +# For further documentation, please reference the GitHub repository. # +# https://github.com/lissy93/awesome-privacy or awesome-privacy.xyz # +# # +######################################################################### +# Licensed under CC0-1.0 (C) Alicia Sykes # +######################################################################### + +# Targets +.PHONY: all \ + install_lib_deps gen_readme validate lib \ + install_web_deps build_web start_web web + +# Get Python bin +PYTHON := $(shell which python3 2>/dev/null || which python) + +# Directory Locations +LIB_DIR := lib +WEB_DIR := web + +# Targets for lib/ +install_lib_deps: + $(PYTHON) -m pip install -r $(LIB_DIR)/requirements.txt + +gen_readme: install_lib_deps + $(PYTHON) $(LIB_DIR)/awesome-privacy-readme-gen.py + +validate: install_lib_deps + $(PYTHON) $(LIB_DIR)/validate-awesome-privacy.py + +lib: install_lib_deps validate gen_readme + +# Targets for web/ +install_web_deps: + cd $(WEB_DIR) && yarn install + +build_web: install_web_deps + cd $(WEB_DIR) && yarn build + +start_web: build_web + cd $(WEB_DIR) && yarn start + +dev_web: install_web_deps + cd $(WEB_DIR) && yarn dev + +web: install_web_deps build_web start_web