home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / splint3s.zip / splint-3.0.1.6 / os2 / Makefile.os2 < prev    next >
Makefile  |  2002-02-17  |  6KB  |  212 lines

  1. ##################################################
  2. ###
  3. ### Makefile for OS/2 version of splint
  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 VisualAge C++ 3.0
  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 splint from scratch using optimizations
  27. ###
  28. ### This makefile uses gmake, the gnu version of make.
  29. ###
  30. ### Run gmake to build splint.
  31. ###     gmake install to install.
  32. ###
  33.  
  34. SHELL=/usr/bin/ksh
  35.  
  36.  
  37. ###
  38. ### This needs to be configured:
  39. ###
  40.  
  41. ### Directory containing system include files:
  42.  
  43. SYSTEM_LIBDIR = e:/usr/include
  44.  
  45. ### default preprocessor command:
  46.  
  47. CPPCMD = cpp 
  48.  
  49. ### directory for splint standard imports
  50. DEFAULT_LCLIMPORTDIR = .;e:/usr/lib/splint/imports
  51.  
  52. ### directory for splint libraries
  53. DEFAULT_LARCHPATH  = .;e:/usr/lib/splint/lib
  54.  
  55. ### directory for splint binary
  56. INSTALLDIR = e:/usr/bin
  57.  
  58. ### system include directory
  59. GCC_INCLUDE_DIR = e:/usr/include
  60.  
  61. ### alternate system include directory
  62. GCC_INCLUDE_DIR2 = e:/emx/include
  63.  
  64. ###
  65. ### Cosmetic stuff (goes into the executable
  66. ###
  67.  
  68. LCL_OS2 = 1
  69. TARGET_CPU = i586
  70. UNAME = OS/2 Warp 4 (Paulina)
  71.  
  72. ###
  73. ### do you have bison and/or flex?
  74. ### (Note: yacc will probably not work; lex might work but is not recommended.)
  75. ###
  76.  
  77. BISON     = bison
  78. FLEX      = flex
  79. YFLAGS    = -v -t -d
  80. LFLAGS    =
  81.  
  82. ###
  83. ### Set automatically: splint version and date etc.
  84. ###
  85.  
  86. LCL_VERSION := $(shell grep "^VERSION" ../configure | sed "s/VERSION *= *//")
  87. LCL_DATE := $(shell date +"%d %b %Y")
  88. BUILD_DATE := $(shell date +"%c")
  89. ME := $(shell whoami)
  90. BASEDIR := $(shell (cd ..; cmd /c cd | tr '\\' '/'))
  91.  
  92. LCL_COMPILE = Compiled using $(CC)\\n on $(UNAME) $(TARGET_CPU) $(BUILD_DATE) by $(ME),\\n OS/2 specific subversion is $(LCL_OS2)
  93. LCL_PARSE_VERSION = Splint $(LCL_VERSION)
  94. SPLINT_VERSION = $(LCL_PARSE_VERSION) -- $(LCL_DATE)
  95.  
  96.  
  97. ###
  98. ### Then, run:
  99. ###
  100. ###    make
  101. ###
  102. ###
  103.  
  104. ### file-related commands (I use emx GNUish utilities)
  105. CP = cp
  106. MV = mv
  107. CAT = cat
  108. RM = rm
  109. INSTALL = cp
  110. INSTALLFLAGS =           
  111. ECHO = echo
  112.  
  113. ###
  114. ### compiler --- gcc is recommended, but splint 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 -g
  126.  CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
  127.  CFLAGS=-Wall 
  128.  OFLAG=-o 
  129.  LDFLAGS = -lfl
  130.  O=.o
  131.  EXEEXT=.exe
  132. else
  133.  ifeq ($(COMPILER), gcc-os2)
  134.   CC = gcc -Zsys -Zomf -O3
  135.   CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
  136.   CFLAGS=-Wall 
  137.   OFLAG=-o 
  138.   LDFLAGS = splint.def -lfl
  139.   O=.obj
  140.   EXEEXT=.exe
  141.  else
  142.   ifeq ($(COMPILER), icc-os2)
  143.    # Shame! Normally no warnings should be turned off, but IBM's are
  144.    # so stupid they warn me about each llassert(). Let's check our
  145.    # code using splint then develop it on gcc and then move to IBMC...
  146.    CC = icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+ 
  147.    #CSet 2.01 needs this:
  148.    #-D__STDC__
  149.    CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 
  150.    CFLAGS=
  151.    OFLAG=-fe
  152.    LDFLAGS = -B/noe setargv.obj fl.lib splint.def
  153.    O=.obj
  154.    EXEEXT=.exe
  155.   endif
  156.  endif
  157. endif
  158.  
  159. .PHONY: all clean config confclean
  160.  
  161. all: make.vars ../config.h setenv.cmd
  162.     $(MAKE) --directory=../src -f Makefile.os2 all
  163.     $(MAKE) --directory=../lib -f Makefile.os2 all
  164.  
  165. make.vars:
  166.     echo "CC = $(CC)" >make.vars
  167.     echo "CPPFLAGS = $(CPPFLAGS)" >>make.vars
  168.     echo "CFLAGS = $(CFLAGS)" >>make.vars
  169.     echo "OFLAG = $(OFLAG)" >>make.vars
  170.     echo "LDFLAGS = $(LDFLAGS)" >>make.vars
  171.     echo "O = $(O)" >>make.vars
  172.     echo "EXEEXT = $(EXEEXT)" >>make.vars
  173.     echo "BISON = $(BISON)" >>make.vars
  174.     echo "FLEX = $(FLEX)" >>make.vars
  175.     echo "YFLAGS = $(YFLAGS)" >>make.vars
  176.     echo "LFLAGS = $(LFLAGS)" >>make.vars
  177.     echo "CPPCMD = $(CPPCMD)" >>make.vars
  178.     echo "CP = $(CP)" >>make.vars
  179.     echo "MV = $(MV)" >>make.vars
  180.     echo "CAT = $(CAT)" >>make.vars
  181.     echo "RM = $(RM)" >>make.vars
  182.     echo "INSTALL = $(INSTALL)" >>make.vars
  183.     echo "INSTALLFLAGS = $(INSTALLFLAGS)" >>make.vars
  184.     echo "ECHO = $(ECHO)" >>make.vars
  185.  
  186. ../config.h: os2config.h.in
  187.     sed -e 's|@DEFAULT_LARCHPATH@|$(DEFAULT_LARCHPATH)|' \
  188.     -e 's|@DEFAULT_LCLIMPORTDIR@|$(DEFAULT_LCLIMPORTDIR)|' \
  189.     -e 's|@GCC_INCLUDE_DIR@|$(GCC_INCLUDE_DIR)|' \
  190.     -e 's|@GCC_INCLUDE_DIR2@|$(GCC_INCLUDE_DIR2)|' \
  191.     -e 's|@TARGET_CPU@|$(TARGET_CPU)|' \
  192.     -e 's|@UNAME@|$(UNAME)|' \
  193.     -e 's|@LCL_COMPILE@|$(LCL_COMPILE)|' \
  194.     -e 's|@LCL_PARSE_VERSION@|$(LCL_PARSE_VERSION)|' \
  195.     -e 's|@SPLINT_VERSION@|$(SPLINT_VERSION)|' \
  196.     -e 's|@SYSTEM_LIBDIR@|$(SYSTEM_LIBDIR)|' \
  197.     os2config.h.in >../config.h
  198.  
  199. setenv.cmd: setenv.cmd.in
  200.     sed -e 's|@LCL_VERSION@|$(LCL_VERSION)|' \
  201.     -e 's|@BASEDIR@|$(BASEDIR)|' \
  202.     setenv.cmd.in | tr '/' '\\\\' >setenv.cmd
  203.  
  204. config: make.vars ../config.h setenv.cmd
  205.  
  206. confclean:
  207.     $(RM) -f make.vars ../config.h setenv.cmd
  208.  
  209. clean: confclean
  210.     $(MAKE) --directory=../src -f Makefile.os2 clean
  211.     $(MAKE) --directory=../lib -f Makefile.os2 clean
  212.