Newer
Older
##########################################################################
# #
# This file is part of Frama-C. #
# #
# CEA (Commissariat à l'énergie atomique et aux énergies #
# alternatives) #
# #
# 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, version 2.1. #
# #
# It 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. #
# #
# See the GNU Lesser General Public License version 2.1 #
# for more details (enclosed in the file licenses/LGPLv2.1). #
# #
##########################################################################
SPLIT = $(patsubst %,generated/split/cfg_%.ml,options core register gui) generated/split/Makefile
SINGLE_FILE = visitor value value_with_gui value_gui_options value_gui_state_no_clear \
value_gui_state_clear
FINAL_PLUGINS = $(patsubst %,generated/%/cfg_print.ml,$(SINGLE_FILE)) $(SPLIT)
all: clean dirs $(FINAL_PLUGINS)
DIRS = generated $(addprefix generated/,src intermediary $(SINGLE_FILE) split)
MLIS=$(addsuffix /ViewCfg.mli,$(filter-out generated, $(DIRS)))
dirs: $(DIRS) $(MLIS)
mkdir -p $@
generated/src/%: src/%
cp $< $@
generated/%/ViewCfg.mli: src/ViewCfg.mli
cp $< $@
generated/intermediary/print_cfg_novalue.ml: generated/src/print_cfg_begin.ml\
generated/src/print_cfg_vfile.ml\
generated/src/print_cfg_vglob.ml\
generated/src/print_cfg_vstmt_aux_novalue.ml\
generated/src/print_cfg_end.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/intermediary/print_cfg_value.ml: generated/src/print_cfg_begin.ml\
generated/src/print_cfg_vfile.ml\
generated/src/print_cfg_vglob.ml\
generated/src/print_cfg_vstmt_aux_value.ml\
generated/src/print_cfg_end.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/intermediary/dump_function_memo_no_clear_cache_and_deps.ml:\
generated/src/register_cfg_graph_state.ml\
generated/src/dump_to_string_memoized.ml\
generated/src/dump_function_memo_no_clear_cache.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/intermediary/dump_function_memo_clear_cache_and_deps.ml:\
generated/src/register_cfg_graph_state.ml\
generated/src/dump_to_string_memoized.ml\
generated/src/register_value_computed_state.ml\
generated/src/dump_function_memo_clear_cache.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
# "Final" plugins.
generated/visitor/cfg_print.ml: generated/src/print_stmt.ml\
generated/intermediary/print_cfg_novalue.ml\
generated/src/extend_with_simple_run.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/value/cfg_print.ml: generated/src/print_stmt.ml\
generated/intermediary/print_cfg_value.ml\
generated/src/extend_with_simple_run.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/value_with_gui/cfg_print.ml: generated/value/cfg_print.ml\
generated/src/dump_function.ml\
generated/src/gui.ml
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/value_gui_options/cfg_print.ml: generated/src/print_stmt.ml\
generated/intermediary/print_cfg_value.ml\
generated/src/register_and_options.ml\
generated/src/extend_with_run_with_options.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/value_gui_state_no_clear/cfg_print.ml:\
generated/src/print_stmt.ml\
generated/intermediary/print_cfg_value.ml\
generated/src/register_and_options.ml\
generated/src/extend_with_run_with_options.ml\
generated/intermediary/dump_function_memo_no_clear_cache_and_deps.ml\
generated/src/gui.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/value_gui_state_clear/cfg_print.ml:\
generated/src/print_stmt.ml\
generated/intermediary/print_cfg_value.ml\
generated/src/register_and_options.ml\
generated/src/extend_with_run_with_options.ml\
generated/intermediary/dump_function_memo_clear_cache_and_deps.ml\
generated/src/gui.ml
rm -f $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/split/cfg_options.ml: generated/src/register_and_options.ml
cp $^ $@
generated/split/cfg_core.ml: generated/src/print_stmt.ml\
generated/intermediary/print_cfg_value.ml\
generated/src/dump_function.ml
rm -f $@
echo "module Options = Cfg_options" >> $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/split/cfg_register.ml: generated/src/extend_with_run_with_options.ml
echo "open Cfg_options" > $@
echo "open Cfg_core" >> $@
echo "" >> $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/split/cfg_gui.ml: generated/src/gui.ml
echo "open Cil_types" > $@
echo "open Cfg_core" >> $@
echo "module Options = Cfg_options" >> $@
echo "" >> $@
for i in $^; do cat $$i >> $@; echo "" >> $@; done
generated/split/Makefile: src/Makefile.split
cp $^ $@
pdfs/modules.pdf:
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
cd generated/split && make doc
cd pdfs && dot -Tpdf ../generated/split/doc/code/modules.dot -o modules.pdf
#NB: To add modules prefix, I will just use sed. e.g. sed/print_cfg/Cfg_print.print_cfg/g
#NB: Sinon, je fait des open au debut des modules; tout simplement.
# Tests
tests-no-gui: $(patsubst %,generated/%/cfg_print.ml,visitor value)
frama-c tests/test.c -load-script generated/visitor/cfg_print.ml && cat cfg.out
frama-c tests/test.c -val -then -load-script generated/value/cfg_print.ml && cat cfg.out
frama-c tests/test.c -load-script generated/value/cfg_print.ml && cat cfg.out
tests-with-gui: $(patsubst %,generated/%/cfg_print.ml,value_with_gui)
# frama-c-gui tests/test.c -val -then -load-script generated/value_with_gui/cfg_print.ml
frama-c-gui tests/test.c -val -then -load-script generated/value_gui_options/cfg_print.ml
tests-split:
cd generated/split && make
clean:
rm -Rf generated