Makefile
63 lines · 2411 bytes
1
2#########################################################################
3# Welcome to Awesome Privacy! #
4# This file contains all the commands for the project (in lib and web) #
5# #
6# lib commands: #
7# make install_lib_deps - Install Python dependencies for lib/ #
8# make validate - Validates awesome-privacy.yml against the schema #
9# make gen_readme - Generate README.md from awesome-privacy.yml #
10# #
11# web commands: #
12# make install_web_deps - Install NPM dependencies for the website #
13# make build_web - Build the static website (outputs to web/dist/) #
14# make start_web - Starts a webserver to serve the static website #
15# #
16# For further documentation, please reference the GitHub repository. #
17# https://github.com/lissy93/awesome-privacy or awesome-privacy.xyz #
18# #
19#########################################################################
20# Licensed under CC0-1.0 (C) Alicia Sykes <https://aliciasykes.com> #
21#########################################################################
22
23# Targets
24.PHONY: all \
25 install_lib_deps gen_readme gen_changelog validate lib \
26 install_web_deps build_web start_web web
27
28# Get Python bin
29PYTHON := $(shell which python3 2>/dev/null || which python)
30
31# Directory Locations
32LIB_DIR := lib
33WEB_DIR := web
34
35# Targets for lib/
36install_lib_deps:
37 $(PYTHON) -m pip install -q -r $(LIB_DIR)/requirements.txt
38
39gen_readme: install_lib_deps
40 $(PYTHON) $(LIB_DIR)/awesome-privacy-readme-gen.py
41
42validate: install_lib_deps
43 $(PYTHON) $(LIB_DIR)/validate-awesome-privacy.py
44
45gen_changelog: install_lib_deps
46 $(PYTHON) $(LIB_DIR)/generate-changelog.py
47
48lib: install_lib_deps validate gen_readme gen_changelog
49
50# Targets for web/
51install_web_deps:
52 cd $(WEB_DIR) && yarn install
53
54build_web: install_web_deps
55 cd $(WEB_DIR) && yarn build
56
57start_web: build_web
58 cd $(WEB_DIR) && yarn start
59
60dev_web: install_web_deps
61 cd $(WEB_DIR) && yarn dev
62
63web: install_web_deps build_web start_web