1 ##################################################
\r
3 ### Makefile for OS/2 version of splint
\r
5 ### designed for use with gmake (GNU make)
\r
7 ### based on David Evans' original makefile for Unix systems automatically
\r
8 ### generated by configure on a Linux system.
\r
10 ### configuration is set here and written to file config.inc included by
\r
13 ### supported compilers are:
\r
15 ### IBM VisualAge C++ 3.0
\r
17 ### other system requirements:
\r
18 ### HPFS filesystem (long filenames).
\r
20 ### *NOTE*, before running "make" edit this file to fit your local settings!
\r
21 ### ========================================================================
\r
26 ### builds a release version of splint from scratch using optimizations
\r
28 ### This makefile uses gmake, the gnu version of make.
\r
30 ### Run gmake to build splint.
\r
31 ### gmake install to install.
\r
38 ### This needs to be configured:
\r
41 ### Directory containing system include files:
\r
43 SYSTEM_LIBDIR = e:/usr/include
\r
45 ### default preprocessor command:
\r
49 ### directory for splint standard imports
\r
50 DEFAULT_LCLIMPORTDIR = .;e:/usr/lib/splint/imports
\r
52 ### directory for splint libraries
\r
53 DEFAULT_LARCHPATH = .;e:/usr/lib/splint/lib
\r
55 ### directory for splint binary
\r
56 INSTALLDIR = e:/usr/bin
\r
58 ### system include directory
\r
59 GCC_INCLUDE_DIR = e:/usr/include
\r
61 ### alternate system include directory
\r
62 GCC_INCLUDE_DIR2 = e:/emx/include
\r
65 ### Cosmetic stuff (goes into the executable
\r
70 UNAME = OS/2 Warp 4 (Paulina)
\r
73 ### do you have bison and/or flex?
\r
74 ### (Note: yacc will probably not work; lex might work but is not recommended.)
\r
83 ### Set automatically: splint version and date etc.
\r
86 LCL_VERSION := $(shell grep "^VERSION" ../configure | sed "s/VERSION *= *//")
\r
87 LCL_DATE := $(shell date +"%d %b %Y")
\r
88 BUILD_DATE := $(shell date +"%c")
\r
89 ME := $(shell whoami)
\r
90 BASEDIR := $(shell (cd ..; cmd /c cd | tr '\\' '/'))
\r
92 LCL_COMPILE = Compiled using $(CC)\\n on $(UNAME) $(TARGET_CPU) $(BUILD_DATE) by $(ME),\\n OS/2 specific subversion is $(LCL_OS2)
\r
93 LCL_PARSE_VERSION = Splint $(LCL_VERSION)
\r
94 SPLINT_VERSION = $(LCL_PARSE_VERSION) -- $(LCL_DATE)
\r
104 ### file-related commands (I use emx GNUish utilities)
\r
114 ### compiler --- gcc is recommended, but splint has been compiled
\r
115 ### without changes using cc on several platforms.
\r
118 # name of configuration:
\r
123 # compile commands:
\r
124 ifeq ($(COMPILER), gcc-emx)
\r
126 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
133 ifeq ($(COMPILER), gcc-os2)
\r
134 CC = gcc -Zsys -Zomf -O3
\r
135 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
138 LDFLAGS = splint.def -lfl
\r
142 ifeq ($(COMPILER), icc-os2)
\r
143 # Shame! Normally no warnings should be turned off, but IBM's are
\r
144 # so stupid they warn me about each llassert(). Let's check our
\r
145 # code using splint then develop it on gcc and then move to IBMC...
\r
146 CC = icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+
\r
147 #CSet 2.01 needs this:
\r
149 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
152 LDFLAGS = -B/noe setargv.obj fl.lib splint.def
\r
159 .PHONY: all clean config confclean
\r
161 all: make.vars ../config.h setenv.cmd
\r
162 $(MAKE) --directory=../src -f Makefile.os2 all
\r
163 $(MAKE) --directory=../lib -f Makefile.os2 all
\r
166 echo "CC = $(CC)" >make.vars
\r
167 echo "CPPFLAGS = $(CPPFLAGS)" >>make.vars
\r
168 echo "CFLAGS = $(CFLAGS)" >>make.vars
\r
169 echo "OFLAG = $(OFLAG)" >>make.vars
\r
170 echo "LDFLAGS = $(LDFLAGS)" >>make.vars
\r
171 echo "O = $(O)" >>make.vars
\r
172 echo "EXEEXT = $(EXEEXT)" >>make.vars
\r
173 echo "BISON = $(BISON)" >>make.vars
\r
174 echo "FLEX = $(FLEX)" >>make.vars
\r
175 echo "YFLAGS = $(YFLAGS)" >>make.vars
\r
176 echo "LFLAGS = $(LFLAGS)" >>make.vars
\r
177 echo "CPPCMD = $(CPPCMD)" >>make.vars
\r
178 echo "CP = $(CP)" >>make.vars
\r
179 echo "MV = $(MV)" >>make.vars
\r
180 echo "CAT = $(CAT)" >>make.vars
\r
181 echo "RM = $(RM)" >>make.vars
\r
182 echo "INSTALL = $(INSTALL)" >>make.vars
\r
183 echo "INSTALLFLAGS = $(INSTALLFLAGS)" >>make.vars
\r
184 echo "ECHO = $(ECHO)" >>make.vars
\r
186 ../config.h: os2config.h.in
\r
187 sed -e 's|@DEFAULT_LARCHPATH@|$(DEFAULT_LARCHPATH)|' \
\r
188 -e 's|@DEFAULT_LCLIMPORTDIR@|$(DEFAULT_LCLIMPORTDIR)|' \
\r
189 -e 's|@GCC_INCLUDE_DIR@|$(GCC_INCLUDE_DIR)|' \
\r
190 -e 's|@GCC_INCLUDE_DIR2@|$(GCC_INCLUDE_DIR2)|' \
\r
191 -e 's|@TARGET_CPU@|$(TARGET_CPU)|' \
\r
192 -e 's|@UNAME@|$(UNAME)|' \
\r
193 -e 's|@LCL_COMPILE@|$(LCL_COMPILE)|' \
\r
194 -e 's|@LCL_PARSE_VERSION@|$(LCL_PARSE_VERSION)|' \
\r
195 -e 's|@SPLINT_VERSION@|$(SPLINT_VERSION)|' \
\r
196 -e 's|@SYSTEM_LIBDIR@|$(SYSTEM_LIBDIR)|' \
\r
197 os2config.h.in >../config.h
\r
199 setenv.cmd: setenv.cmd.in
\r
200 sed -e 's|@LCL_VERSION@|$(LCL_VERSION)|' \
\r
201 -e 's|@BASEDIR@|$(BASEDIR)|' \
\r
202 setenv.cmd.in | tr '/' '\\\\\\' >setenv.cmd
\r
204 config: make.vars ../config.h setenv.cmd
\r
207 $(RM) -f make.vars ../config.h setenv.cmd
\r
210 $(MAKE) --directory=../src -f Makefile.os2 clean
\r
211 $(MAKE) --directory=../lib -f Makefile.os2 clean
\r