-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
61 lines (48 loc) · 1.32 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
52
53
54
55
56
57
58
59
60
61
# A template makefile that works for static websites.
# Need to export as ENV var
export TEMPLATE_DIR = templates
export MARKDOWN_DIR = markdown_files
PTML_DIR = html_src
UTILS_DIR = utils
BACK_DIR = backend
TEST_DIR = tests
PYLINT = flake8
PYLINTFLAGS =
PYTHONFILES = $(shell ls $(BACK_DIR)/*.py)
PYTHON_FILES += $(shell ls $(TEST_DIR)/*.py)
INCS = $(TEMPLATE_DIR)/head.txt $(TEMPLATE_DIR)/logo.txt $(TEMPLATE_DIR)/menu.txt
CONTCMD = sh build_container.sh
HTMLFILES = $(shell ls $(PTML_DIR)/*.ptml | sed -e 's/.ptml/.html/' | sed -e 's/html_src\///')
FORCE:
%.html: $(PTML_DIR)/%.ptml $(INCS)
python3 $(UTILS_DIR)/html_checker.py $<
$(UTILS_DIR)/render_md.awk <$< | $(UTILS_DIR)/html_include.awk >$@
git add $@
local: $(HTMLFILES)
prod: $(INCS) $(HTMLFILES)
-git commit -a
git pull origin master
git push origin master
lint: $(patsubst %.py,%.pylint,$(PYTHONFILES))
%.pylint:
$(PYLINT) $(PYLINTFLAGS) $*.py
tests: FORCE
#$(CONTCMD) [docker hub name] [local name]
$(CONTCMD) cplusplus cpp
$(CONTCMD) dc dc
$(CONTCMD) java java
$(CONTCMD) os os
$(CONTCMD) pbda pbda
$(CONTCMD) pl pl
$(CONTCMD) python python
#$(CONTCMD) springboot springboot
pytest tests/
submods:
git submodule foreach 'git pull origin master'
nocrud:
rm *~
rm .*swp
rm $(PTML_DIR)/*~
rm $(PTML_DIR)/.*swp
clean:
touch $(PTML_DIR)/*.ptml; make local