home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / build / Makefile.os2
Makefile  |  1997-09-12  |  7KB  |  287 lines

  1. ##################################################
  2. ###                                         
  3. ### Makefile for OS/2 version of LCLint                     
  4. ###                                         
  5. ### designed for use with gmake (GNU make)
  6. ###
  7. ### based on David Evans' original makefile for Unix systems automatically
  8. ###  generated by configure on a Linux system.
  9. ###
  10. ### configuration is set here and written to file config.inc included by
  11. ###  other makefiles
  12. ###
  13. ### supported compilers are:
  14. ###  emx/gcc
  15. ###  IBM CSet++ 2.1
  16. ###
  17. ### other system requirements:
  18. ###  HPFS filesystem (long filenames).
  19. ###
  20. ### *NOTE*, before running "make" edit this file to fit your local settings!
  21. ### ========================================================================
  22. ###
  23. ### Commands:
  24. ###
  25. ### make all 
  26. ###    builds a release version of lclint from scratch using optimizations
  27. ###
  28. ### This makefile uses gmake, the gnu version of make.
  29. ###
  30. ### Run gmake to build LCLint.
  31. ###     gmake install to install.
  32. ###
  33.  
  34. ###
  35. ### lclint version and date:
  36. ###
  37.  
  38. LCL_VERSION=2.3h
  39. LCL_DATE=03 Sep 97
  40.  
  41. ###
  42. ### Personal stuff:
  43. ###
  44.  
  45. # this gets written into the binary, add your name, your compiler settings
  46. #  etc. if you like.
  47. TODAY=Thursday 12 September 12:12 MEST 1997
  48. ME=herbert
  49. MACHINE=i586
  50. COMPILE_MSG=\# define LCL_COMPILE "Compiled using $(CC)\n on OS/2 $(TODAY) $(MACHINE) by $(ME),\n OS/2 specific subversion is 2"
  51.  
  52. ###
  53. ### the following variables will have to be configured to fit
  54. ###  local settings:
  55. ###
  56.  
  57. ### Directory containing system include files:
  58.  
  59. SYSTEM_LIBDIR   = "\\usr\\include"
  60.  
  61. ### default preprocessor command:
  62.  
  63. CPPCMD = "cpp "
  64.  
  65. ###
  66. ### Select installation directories:
  67. ###
  68. ### The LIBDIR and IMPORTSDIR are compiled into the binary to 
  69. ### select the default LARCH_PATH and LCLIMPORTDIR, which can 
  70. ### also be overridden by environment variables.
  71. ###
  72. ### It may be a good idea to edit these variables not only in this
  73. ### makefile but also in the header file src/Headers/local_constants.h
  74. ### 
  75.  
  76. ### directory for lclint libraries
  77. LIBDIR     = \\usr\\lib\\lclint\\lib
  78.  
  79. ### directory for lclint standard imports
  80. IMPORTSDIR = \\usr\\lib\\lclint\\imports
  81.  
  82. ### these are automatically set:
  83.  
  84. SYSTEM_IMPORTSDIR = "$(IMPORTSDIR)"
  85. SYSTEM_LARCHPATH  = ".;$(LIBDIR)"
  86.  
  87. ###
  88. ### More local variables needed for doing "make install"
  89. ###
  90.  
  91. ### directory for lclint binary
  92. INSTALLDIR = \usr\bin
  93.  
  94. ### directory for installing lclint.el[c]
  95. EMACSLIBDIR = \emacs\site-lisp
  96.  
  97. ### this should be the complete path for the directory where this
  98. ### Makefile is, with no trailing \ or spaces.
  99.  
  100. BASEDIR = \usr\src\lclint-2.2a
  101.  
  102. ###
  103. ### Commands settings (compiler etc.)
  104. ###
  105.  
  106. ### Shell-commands:
  107. CP            = copy
  108. INSTALL     = copy
  109. CAT         = type
  110. MV          = mv
  111. INSTALLFLAGS =           
  112.  
  113. ###
  114. ### compiler --- gcc is recommended, but lclint has been compiled
  115. ###              without changes using cc on several platforms.
  116. ###
  117.  
  118. # name of configuration:
  119. #COMPILER=gcc-emx
  120. #COMPILER=gcc-os2
  121. COMPILER=icc-os2
  122.  
  123. # compile commands:
  124. ifeq ($(COMPILER), gcc-emx)
  125.  CC = gcc -O3
  126.  CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 
  127.  CFLAGS=
  128.  OFLAG=-o 
  129.  LINKFLAGS = -lfl
  130.  O=.o
  131.  E=.exe
  132. else
  133.  ifeq ($(COMPILER), gcc-os2)
  134.   CC = gcc -Zsys -Zomf -O3
  135.   CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 
  136.   CFLAGS=
  137.   OFLAG=-o 
  138.   LINKFLAGS = lclint.def -lfl
  139.   O=.obj
  140.   E=.exe
  141.  else
  142.   ifeq ($(COMPILER), icc-os2)
  143.    CC = icc -q -Dunlink=unlink -D__STDC__ -O+ -G5 -Gf+ -Gi+ -Gs+ 
  144.    CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
  145.    CFLAGS=
  146.    OFLAG=-fe
  147.    LINKFLAGS = ..\libfl\fl.lib lclint.def
  148.    O=.obj
  149.    E=.exe
  150.   endif
  151.  endif
  152. endif
  153.  
  154. ###
  155. ### do you have bison and/or flex?
  156. ### (Note: yacc will probably not work; lex might work but is not recommended.)
  157. ###
  158.  
  159. BISON     = bison
  160. FLEX      = flex
  161. YFLAGS    = -v -t -d
  162. LFLAGS      = 
  163.  
  164. ### 
  165. ### if this Makefile is used with one of the
  166. ### standard installation packages, no changes should be 
  167. ### necessary below this line.
  168. ###
  169.  
  170. .PHONY: install dobinaries dolibraries doimports doemacs
  171.  
  172. ###
  173. ### set this to a different directory
  174. ### to install binaries elsewhere
  175. ###
  176.  
  177. RELEASEDIR      = $(BASEDIR)\bin
  178.  
  179. all: bin\lclint$E
  180. lclint: bin\lclint$E
  181.  
  182. bin\lclint$E: 
  183.     @cmd /c echo.
  184.     @echo Creating configuration file. Syntax error message can be ignored...
  185.     @cmd /c echo.
  186.     $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc  
  187.     @cmd /c echo.
  188.     @echo Creating local constants header file. Syntax error messages can be ignored...
  189.     @cmd /c echo.
  190.     $(MAKE) -f Makefile.os2 --directory=src --warn-undefined-variables localconstants 
  191.     @cmd /c echo.
  192.     @echo Now building lclint executable file...
  193.     @cmd /c echo.
  194.     $(MAKE) -f Makefile.os2 --directory=src --warn-undefined-variables
  195.     @cmd /c echo.
  196.     @echo Now moving lclint executable file to bin directory...
  197.     @cmd /c echo.
  198.     mv src\lclint$E bin\lclint$E
  199.  
  200. configinc:
  201.     echo CC=$(CC) >config.inc
  202.     echo CFLAGS=$(CFLAGS) >>config.inc
  203.     echo CPPFLAGS=$(CPPFLAGS) >>config.inc
  204.     echo BISON=$(BISON) >>config.inc
  205.     echo FLEX=$(FLEX) >>config.inc
  206.     echo YFLAGS=$(YFLAGS) >>config.inc
  207.     echo LFLAGS=$(LFLAGS) >>config.inc
  208.     echo SYSTEM_LIBDIR=$(SYSTEM_LIBDIR) >>config.inc
  209.     echo DEFAULT_LCLIMPORTDIR=$(SYSTEM_IMPORTSDIR)  >>config.inc
  210.     echo DEFAULT_LARCHPATH=$(SYSTEM_LARCHPATH)  >>config.inc
  211.     echo DEFAULT_CPPCMD=$(CPPCMD)  >>config.inc
  212.     echo LINKFLAGS=$(LINKFLAGS)  >>config.inc
  213.     echo O=$O  >>config.inc
  214.     echo E=$E >>config.inc
  215.     echo OFLAG=$(OFLAG)lclint$E >>config.inc
  216.     echo CAT=$(CAT) >>config.inc
  217.     echo MV=$(MV) >>config.inc
  218.     $(CP) src\Headers\herald.h src\Headers\herald.last
  219.     echo /* herald.h - created automatically from herald.os2 and Makefile.os2 */ >src\Headers\herald.h
  220.     echo /*@constant observer char *LCL_VERSION;@*/ >>src\Headers\herald.h
  221.     echo # define LCL_VERSION "LCLint $(LCL_VERSION) --- $(LCL_DATE)" >>src\Headers\herald.h
  222.     echo /*@constant observer char *LCL_PARSE_VERSION;@*/ >>src\Headers\herald.h
  223.     echo # define LCL_PARSE_VERSION "LCLint $(LCL_VERSION)" >>src\Headers\herald.h
  224.     echo /*@constant observer char *LCL_COMPILE;@*/ >>src\Headers\herald.h
  225.     echo $(COMPILE_MSG) >>src\Headers\herald.h
  226.  
  227. clean:
  228.     $(MAKE) --directory=src -f Makefile.os2 clean
  229.     rm bin\lclint.exe    
  230.  
  231. ###
  232. ### locations of standard LCLint files
  233. ###
  234. ### this should NOT have to be edited if you use the standard
  235. ###    installation package
  236.  
  237. CP  = cp
  238.  
  239. LCLINTBINDIR = $(BASEDIR)\bin
  240. LCLINTBIN  = lclint.exe
  241.  
  242. LCLINTLIB = $(BASEDIR)\lib
  243. LCLINTIMPORTS = $(BASEDIR)\imports
  244.  
  245. LCLINTEMACS = $(BASEDIR)\emacs\lclint.el
  246. LCLINTEMACSC = $(BASEDIR)\emacs\lclint.elc
  247.  
  248. ###
  249. ### uses recursive make calls directly, so installation
  250. ### will continue even if there are errors!
  251. ###
  252.  
  253. install: 
  254.     $(MAKE) dobinaries   -f Makefile.os2
  255.     $(MAKE) dolibraries  -f Makefile.os2
  256.     $(MAKE) doimports    -f Makefile.os2
  257.     $(MAKE) doemacs      -f Makefile.os2
  258.  
  259. doemacs:
  260.     $(CP) $(LCLINTEMACS) $(EMACSLIBDIR)
  261.     $(CP) $(LCLINTEMACSC) $(EMACSLIBDIR)
  262.  
  263. dobinaries:
  264.     $(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR)
  265.  
  266. dolibraries:
  267.     -mkdir$E $(LIBDIR)
  268.     $(CP) $(LCLINTLIB)\\* $(LIBDIR)
  269.  
  270. doimports:
  271.     -mkdir$E $(IMPORTSDIR)
  272.     $(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR)
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.