-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 883 Bytes
/
Makefile
File metadata and controls
38 lines (32 loc) · 883 Bytes
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
# Makefile for: \
Automated execution of code upon change. \
Faster pushing changes to repo. \
# Requires inotifywait, part of inotify-tools (Debian/Ubuntu: apt-get install inotify-tools)
# Written by Jennie Zheng and Haoyu Yun. \
# Modified: 2020 Jun 10
# Example: make script="tmp/A.py"
default:
make run;
@#make watch --silent;
watch:
while true; do \
make run ; \
#wait for changes to script \
inotifywait -qe modify $(script) >> /dev/null; \
done
run: $(script)
python3 $(script);
@# ifeq ($(findstring cpp, $(script)),)
@# g++ -std=c++11 $(script) -o ./A.out; ./A.out;
@# endif
@# ifeq ($(findstring py, $(script)),)
@# autopep8 $(script) --select=E1 --in-place; # to fix indentation
@# python3 $(script);
@# endif
push:
git add .
echo -n "Message: "
read msg; \
echo "git commit -am" $$msg; \
git commit -am "$$msg";
#git push origin master