-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (52 loc) · 1.52 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
#author: Polonio Davide <[email protected]>
#license: MIT
include common/make/flags.inc
FOLDERS= internal official presentations verbal
PATH_ZIP= RA
GROUP_NAME= BugBusters
all: $(FOLDERS)
echo "All documents were built successfully"
zip:
mkdir $(PATH_ZIP)/
mkdir $(PATH_ZIP)/Interni/
mkdir $(PATH_ZIP)/Esterni/
set -e; \
for i in $(wildcard official/*/*.pdf); do \
pathFile=`dirname $$i`; \
nameFile=`basename \`dirname $$i\``; \
if [ "$$pathFile" = "official/NormeDiProgetto" ]; then \
cp $$i $(PATH_ZIP)/Interni/$$nameFile.pdf; \
else \
cp $$i $(PATH_ZIP)/Esterni/$$nameFile.pdf; \
fi; \
done; \
mkdir $(PATH_ZIP)/Interni/Verbali
for i in $(wildcard verbal/*/*.pdf); do \
pathFile=`dirname $$i`; \
nameFile=`basename \`dirname $$i\``; \
cp $$i $(PATH_ZIP)/Interni/Verbali/$$nameFile.pdf; \
done; \
$(ZIP) $(ZIPFLAGS) $(GROUP_NAME).zip $(PATH_ZIP)/*
clean:
rm -rf $(PATH_ZIP)/ $(GROUP_NAME).zip
echo "pdf builds are automatically cleaned when another make is called"
$(FOLDERS):
set -e; \
for i in $(sort $(dir $(wildcard $@/*/))); do \
echo ""; \
echo ""; \
echo "###################################################"; \
echo "Document: $$i"; \
bak=$(shell pwd); \
cd $$i; \
if [ "$$i" = "official/Glossario/" ]; then \
echo "****This is the glossary, calling \"build.sh\" script****"; \
bash build.sh; \
fi; \
echo "****Compilation with $(CC). Flags: $(CCFLAGS)****"; \
$(CC) -C; \
$(CC) $(CCFLAGS); \
cd $$bak; \
done; \
echo "!!! Make for $@ COMPLETE! !!!"; \
echo ""; \