| 1 | # This program is free software; you can redistribute it and/or modify |
| 2 | # it under the terms of the GNU General Public License as published by |
| 3 | # the Free Software Foundation; either version 2 of the License, or |
| 4 | # (at your option) any later version. |
| 5 | # |
| 6 | # This program is distributed in the hope that it will be useful, |
| 7 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 8 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 9 | # GNU General Public License for more details. |
| 10 | # |
| 11 | # You should have received a copy of the GNU General Public License |
| 12 | # along with this program; if not, write to the Free Software |
| 13 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 14 | # |
| 15 | # Copyright (C) Mathieu Desnoyers, 2009 |
| 16 | # |
| 17 | # Authors: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
| 18 | |
| 19 | #CFLAGS=-DSAFETY |
| 20 | CFLAGS=-DHASH64 |
| 21 | |
| 22 | SPINFILE=urcu.spin |
| 23 | |
| 24 | default: |
| 25 | make urcu_free | tee urcu_free.log |
| 26 | make urcu_free_no_rmb | tee urcu_free_no_rmb.log |
| 27 | make urcu_free_no_wmb | tee urcu_free_no_wmb.log |
| 28 | make urcu_free_no_mb | tee urcu_free_no_mb.log |
| 29 | make urcu_free_single_flip | tee urcu_free_single_flip.log |
| 30 | make urcu_progress_writer | tee urcu_progress_writer.log |
| 31 | make urcu_progress_reader | tee urcu_progress_reader.log |
| 32 | make urcu_progress_writer_error | tee urcu_progress_writer_error.log |
| 33 | make asserts | tee asserts.log |
| 34 | make summary |
| 35 | |
| 36 | #show trail : spin -v -t -N pan.ltl input.spin |
| 37 | # after each individual make. |
| 38 | |
| 39 | summary: |
| 40 | @echo |
| 41 | @echo "Verification summary" |
| 42 | @grep errors: *.log |
| 43 | |
| 44 | asserts: clean |
| 45 | cat DEFINES > .input.spin |
| 46 | cat ${SPINFILE} >> .input.spin |
| 47 | rm -f .input.spin.trail |
| 48 | spin -a -X .input.spin |
| 49 | gcc -w ${CFLAGS} -DSAFETY -o pan pan.c |
| 50 | ./pan -v -c1 -X -m10000 -w20 |
| 51 | cp .input.spin $@.spin.input |
| 52 | -cp .input.spin.trail $@.spin.input.trail |
| 53 | |
| 54 | urcu_free: clean urcu_free_ltl run |
| 55 | cp .input.spin $@.spin.input |
| 56 | -cp .input.spin.trail $@.spin.input.trail |
| 57 | |
| 58 | urcu_free_no_rmb: clean urcu_free_ltl urcu_free_no_rmb_define run |
| 59 | cp .input.spin $@.spin.input |
| 60 | -cp .input.spin.trail $@.spin.input.trail |
| 61 | |
| 62 | urcu_free_no_rmb_define: |
| 63 | cp urcu_free_no_rmb.define .input.define |
| 64 | |
| 65 | urcu_free_no_wmb: clean urcu_free_ltl urcu_free_no_wmb_define run |
| 66 | cp .input.spin $@.spin.input |
| 67 | -cp .input.spin.trail $@.spin.input.trail |
| 68 | |
| 69 | urcu_free_no_wmb_define: |
| 70 | cp urcu_free_no_wmb.define .input.define |
| 71 | |
| 72 | urcu_free_no_mb: clean urcu_free_ltl urcu_free_no_mb_define run |
| 73 | cp .input.spin $@.spin.input |
| 74 | -cp .input.spin.trail $@.spin.input.trail |
| 75 | |
| 76 | urcu_free_no_mb_define: |
| 77 | cp urcu_free_no_mb.define .input.define |
| 78 | |
| 79 | urcu_free_single_flip: clean urcu_free_ltl urcu_free_single_flip_define run |
| 80 | cp .input.spin $@.spin.input |
| 81 | -cp .input.spin.trail $@.spin.input.trail |
| 82 | |
| 83 | urcu_free_single_flip_define: |
| 84 | cp urcu_free_single_flip.define .input.define |
| 85 | |
| 86 | urcu_free_ltl: |
| 87 | touch .input.define |
| 88 | cat DEFINES > pan.ltl |
| 89 | cat .input.define >> pan.ltl |
| 90 | spin -f "!(`cat urcu_free.ltl | grep -v ^//`)" >> pan.ltl |
| 91 | |
| 92 | # Progress checks |
| 93 | |
| 94 | urcu_progress_writer: clean urcu_progress_writer_ltl \ |
| 95 | urcu_progress_writer_define run_weak_fair |
| 96 | cp .input.spin $@.spin.input |
| 97 | -cp .input.spin.trail $@.spin.input.trail |
| 98 | |
| 99 | urcu_progress_writer_define: |
| 100 | cp urcu_progress_writer.define .input.define |
| 101 | |
| 102 | urcu_progress_writer_ltl: |
| 103 | touch .input.define |
| 104 | cat DEFINES > pan.ltl |
| 105 | cat .input.define >> pan.ltl |
| 106 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl |
| 107 | |
| 108 | urcu_progress_reader: clean urcu_progress_reader_ltl \ |
| 109 | urcu_progress_reader_define run_weak_fair |
| 110 | cp .input.spin $@.spin.input |
| 111 | -cp .input.spin.trail $@.spin.input.trail |
| 112 | |
| 113 | urcu_progress_reader_define: |
| 114 | cp urcu_progress_reader.define .input.define |
| 115 | |
| 116 | urcu_progress_reader_ltl: |
| 117 | touch .input.define |
| 118 | cat DEFINES > pan.ltl |
| 119 | cat .input.define >> pan.ltl |
| 120 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl |
| 121 | |
| 122 | urcu_progress_writer_error: clean urcu_progress_writer_error_ltl \ |
| 123 | urcu_progress_writer_error_define run_weak_fair |
| 124 | cp .input.spin $@.spin.input |
| 125 | -cp .input.spin.trail $@.spin.input.trail |
| 126 | |
| 127 | urcu_progress_writer_error_define: |
| 128 | cp urcu_progress_writer_error.define .input.define |
| 129 | |
| 130 | urcu_progress_writer_error_ltl: |
| 131 | touch .input.define |
| 132 | cat DEFINES > pan.ltl |
| 133 | cat .input.define >> pan.ltl |
| 134 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl |
| 135 | |
| 136 | |
| 137 | run_weak_fair: pan |
| 138 | ./pan -a -f -v -c1 -X -m10000 -w20 |
| 139 | |
| 140 | run: pan |
| 141 | ./pan -a -v -c1 -X -m10000 -w20 |
| 142 | |
| 143 | pan: pan.c |
| 144 | gcc -w ${CFLAGS} -o pan pan.c |
| 145 | |
| 146 | pan.c: pan.ltl ${SPINFILE} |
| 147 | cat DEFINES > .input.spin |
| 148 | cat .input.define >> .input.spin |
| 149 | cat ${SPINFILE} >> .input.spin |
| 150 | rm -f .input.spin.trail |
| 151 | spin -a -X -N pan.ltl .input.spin |
| 152 | |
| 153 | .PHONY: clean default distclean summary |
| 154 | clean: |
| 155 | rm -f pan* trail.out .input.spin* *.spin.trail .input.define |
| 156 | distclean: |
| 157 | rm -f *.trail *.input *.log |