-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (35 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-License-Identifier: AGPL-3.0-or-later
SHELL=/bin/bash
.DEFAULT_GOAL=help
PYDIST = ./dist
# wrap ./prj script
# -----------------
PRJ += help env.build
PRJ += doc.html doc.live doc.gh-pages doc.prebuild doc.clean
PHONY += $(PRJ)
$(PRJ):
@./prj $@
# local TOPTARGETS
test clean build::
@./prj $@
# Python Package Index (PyPI)
# ---------------------------
PHONY += upload-pypi upload-pypi-test
upload-pypi: clean env.build build
@./prj cmd msg.build PYPI "build and upload python packages"
@./prj cmd twine upload $(PYDIST)/*
upload-pypi-test: clean env.build build
@./prj cmd msg.build PYPI "build and upload python packages (TEST)"
@./prj cmd twine upload -r testpypi $(PYDIST)/*
# run make in subdirectories
# --------------------------
# Makefiles in subdirs needs to define TOPTARGETS::
# .PHONY: all clean test build
TOPTARGETS := all clean test build
SUBDIRS := $(dir $(wildcard */Makefile))
PHONY += $(TOPTARGETS)
$(TOPTARGETS)::
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit $$?; \
done; \
.PHONY: $(PHONY)