-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.88 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
###################################################################
# Makefile #
# #
# Description: Main makefile for clondike project #
# #
# Author: Jan Capek #
# Created: 11/15/2004 #
# #
# Last modified: #
# #
###################################################################
TCMI_VER = 1-06
KKC_VER = 1-02
CLONDIKE_VER = 0-08
SUBDIRS := src test doc
SRCSTATDIR := src-stats
SLOCTOOL = sloccount
SLOCFILE = sloc
# build everything except for docs
.PHONY: all
all:
for dir in $(filter-out doc,$(SUBDIRS)); do $(MAKE) -C $$dir; done
# explicit documentation target
.PHONY: doc
doc:
$(MAKE) -C doc
install:
scripts/install.sh
.PHONY: clean
clean:
rm -f *~
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done
.PHONY: stat
cscope.out:
cscope -Fcscope.out -R -k -b -s$(PWD)/src
# calculates code statistics and creates a .dat file for each
# directory. Used for plotting the data.
stat: clean
@for dir in $(filter-out doc,$(SUBDIRS)); do\
$(SLOCTOOL) --details $$dir > $(SLOCFILE)-$$dir-`date -I`.txt; \
$(SLOCTOOL) $$dir >> $(SLOCFILE)-$$dir-`date -I`.txt; \
stats_file=doc/$${dir}_stats.dat; \
rm -f $$stats_file; \
echo printing into $$stats_file; \
for f in $(SRCSTATDIR)/*$$dir*; do \
oldifs=$$IFS; IFS='-'; set -- $${f%.txt}; \
echo -n $$4-$$5-$$6; IFS=$$oldifs; \
cat $$f | perl -n -e 'print " $$1\n" if($$_=~/.*ansic:\s+(\d+).*/);'; \
done >> $$stats_file; \
done