]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | ### |
11db3170 | 2 | ### Splint db3 test |
885824d3 | 3 | ### |
4 | ### Taken from sample, thirteenth iteration: strictlib | |
5 | ### | |
6 | ||
7 | .SUFFIXES: .lcl .lcs .lh .h .c .o | |
80ee600a | 8 | .PHONY: check clean |
885824d3 | 9 | |
10 | SHELL = /bin/csh -f | |
11 | ||
11db3170 | 12 | SPLINT = splint |
13 | SPLINTF = $(SPLINT) -f ./.splintrc | |
14 | LCL = $(SPLINTF) -specundef +lh +quiet -nof | |
15 | SPLINTLH = $(SPLINTF) +lh | |
885824d3 | 16 | LCSFILES = dbase.lcs employee.lcs empset.lcs erc.lcs eref.lcs ereftab.lcs bool.lcs check.lcs |
17 | MODULES = employee eref empset ereftab erc dbase drive.c bool.lcl check.lcl | |
18 | OBJS = dbase.o employee.o empset.o erc.o eref.o ereftab.o | |
19 | ||
20 | test: | |
a469ccf0 | 21 | @$(MAKE) -e clean |
22 | @$(MAKE) -e check | |
885824d3 | 23 | |
11db3170 | 24 | ### Note there is a .splint file used for checking! |
885824d3 | 25 | |
26 | check: $(LCSFILES) | |
3e3ec469 | 27 | -$(SPLINTF) -showcol $(MODULES) +strict -modfilesystem +showsummary -exportconstant -exportlocal -protoparamprefix p_ |
28 | -$(SPLINTF) -showcol $(MODULES) +strict -modfilesystem +showsummary -exportconstant -exportlocal -protoparamprefix p_ +strictlib -expect 77 | |
885824d3 | 29 | |
30 | ||
31 | ### The following rules generate .lh and .lcs files from .lcl files. They also | |
32 | ### ensure that .h files appear to be updated whenever the corresponding .lh | |
33 | ### file is updated. | |
34 | ||
35 | .lcl.lh: | |
36 | $(LCL) $*.lcl | |
37 | ||
38 | .lcl.lcs: | |
39 | $(LCL) $*.lcl | |
40 | ||
41 | .lh.h: | |
42 | touch $*.h | |
43 | ||
44 | .c.o: | |
45 | $(GCC) -c $*.c | |
46 | ||
47 | ### | |
48 | ### Clean removes junk and all derived files. | |
49 | ### Tidy removes junk and object and executable files. | |
50 | ### | |
51 | ||
52 | clean: tidy | |
53 | -@rm -f *.c.html *.lcl.html *.h.html *.lh.html *.lcs *.lh >& /dev/null | |
54 | ||
55 | tidy: | |
56 | -@rm -f ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~ *~ *.o drive >& /dev/null | |
57 | ||
58 | ### The following dependencies ensure that imported LCL specs | |
59 | ### are checked before the specs that import them. | |
60 | ||
61 | dbase.lcs: employee.lcs empset.lcs | |
62 | empset.lcs: employee.lcs | |
63 | erc.lcs: eref.lcs | |
64 | eref.lcl: employee.lcs | |
65 | ereftab.lcs: employee.lcs eref.lcs | |
66 | ||
67 | ### The following dependencies ensure that a .o file is recompiled when the | |
68 | ### corresponding .c file, or one of the .h files it #includes, is changed. | |
69 | ||
70 | dbase.o: dbase.c bool.h dbase.h employee.h empset.h | |
71 | drive.o: drive.c bool.h dbase.h employee.h empset.h erc.h eref.h ereftab.h | |
72 | employee.o: employee.c employee.h | |
73 | empset.o: empset.c bool.h empset.h erc.h eref.h employee.h employee.h | |
74 | erc.o: erc.c bool.h erc.h eref.h employee.h | |
75 | eref.o: eref.c eref.h employee.h | |
76 | ereftab.o: ereftab.c bool.h ereftab.h erc.h eref.h employee.h | |
77 | ||
78 | ||
79 | ||
80 |