-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdistrib.Makefile
executable file
·90 lines (74 loc) · 2.84 KB
/
distrib.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# C2Newspeak: compiles C code into Newspeak. Newspeak is a minimal language
# well-suited for static analysis.
# Copyright (C) 2007, 2011 Charles Hymans, Olivier Levillain, Sarah Zennou
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#
# Charles Hymans
#
# Sarah Zennou
# sarah(dot)zennou(at)eads(dot)net
VERSION=1.7
#utils
CP=cp
RM=rm -rf
OCAMLDOC=ocamldoc
#FILES
EXE=c2newspeak npkstrip npkstats \
npkcheck ada2newspeak \
simpleai npkmerger ptrtype
COMPONENTS=newspeak $(EXE)
CLEANFILES=*~ bin/* lib/*~ lib/sys/*~ doc/*.html doc/*~ src/version.cmo src/*~ \
bisect-report.xml bisect-report/*
#rules
.PHONY: clean doc lib bisect-report
all: bin $(COMPONENTS) doc lib
# for bisect support you may need the latest version
# darcs get http://bisect.x9c.fr
coverage:
@echo "Generating coverage report"
$(MAKE) WITH_BISECT=1
$(MAKE) check
cd src/ ; bisect-report `find ../tests/ -name bisect*` \
-html ../../cov/$(shell date +%Y%m%d%H%M)
ln -nsf ./$(shell date +%Y%m%d%H%M) ../cov/LATEST
lib: bin bin/lib/assert.h
bin/lib/assert.h:
@-mkdir bin/lib
@echo "Copying libraries in "bin/lib
@$(CP) -r lib/* bin/lib
bin:
@mkdir bin
#WARNING: do not remove the $(MAKECMDGOALS) variable, it is useful to propagate
#the rule.
#For instance, both rules 'clean' and 'all' have the prerequisite $(COMPONENTS)
#When doing make clean, this rule will be called with $(MAKECMDGOALS)
#equal to clean
#Whereas, when doing make all, this rule will be called with $(MAKECMDGOALS)
#equal to all
$(COMPONENTS): src/version.ml
@$(MAKE) -s -C src -f [email protected] $(MAKECMDGOALS)
bisect-report:
cd src; bisect-report `find ../tests/ -name "bisect*.out"` -xml-emma ../bisect-report.xml -html ../bisect-report
doc: doc/index.html
doc/index.html: src/newspeak/newspeak.mli
@echo "Generating documentation in "doc/
@$(OCAMLDOC) -I src -I src/newspeak src/newspeak/newspeak.mli src/newspeak/newspeak.ml -html -d doc -css-style newspeak.css -t "Newspeak - doubleplussimple minilang for static analysis (v. $(VERSION))" -intro doc/npkintro.mldoc -colorize-code
clean: $(COMPONENTS)
@echo "Cleaning files installed in "bin/, doc/
@$(RM) $(CLEANFILES)