home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / test / db1 / Makefile < prev    next >
Makefile  |  1997-09-03  |  2KB  |  74 lines

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