-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
26 lines (21 loc) · 961 Bytes
/
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
.PHONY: templates template-zips
templates-clean:
# Remove previous templates
rm -rf assignments-template
templates: templates-clean
mkdir assignments-template
# Clean up any files that might contain hints
for dir in assignments-complete/*/; do make --directory=$$dir clean; done
# Copy over files
cp -r assignments-complete/* assignments-template/
# Remove code in TODO sections
# This command uses sed -i '', may only work on BSD sed,
# delete the empty single quotes to run with GNU sed
files=$$(grep -rl "BEGIN DELETE BLOCK" assignments-template); \
for file in $$files; do sed -i '' -r '/(\/\/|#|\/\*) BEGIN DELETE BLOCK/,/(\/\/|#|\/\*) END DELETE BLOCK/d' $$file; done
clean: templates-clean template-zips-clean
template-zips: template-zips-clean templates
mkdir template-zips
for dir in assignments-template/*/; do cd $$dir; zip -r ../../template-zips/$$(basename $$dir).zip .; cd ../..; done
template-zips-clean:
rm -rf template-zips