1 ##################################################
\r
3 ### Makefile for OS/2 version of LCLint
\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 lclint from scratch using optimizations
\r
28 ### This makefile uses gmake, the gnu version of make.
\r
30 ### Run gmake to build LCLint.
\r
31 ### gmake install to install.
\r
35 ### lclint version and date:
\r
38 LCL_VERSION=3.0.0.16
\r
39 LCL_DATE=28 Sep 2001
\r
41 # this gets written into the binary, add your name, your compiler settings
\r
43 TODAY=Monday 28 Sep 23:43 MEST 2001
\r
46 COMPILE_MSG=\# define LCL_COMPILE \"Compiled using $(CC)\\n on OS/2 $(TODAY) $(MACHINE) by $(ME),\\n OS/2 specific subversion is 5\"
\r
48 ### Directory containing system include files:
\r
50 SYSTEM_LIBDIR = "\\\\usr\\\\include"
\r
52 ### default preprocessor command:
\r
57 ### Select installation directories:
\r
59 ### The LIBDIR and IMPORTSDIR are compiled into the binary to
\r
60 ### select the default LARCH_PATH and LCLIMPORTDIR, which can
\r
61 ### also be overridden by environment variables.
\r
63 ### It may be a good idea to edit these variables not only in this
\r
64 ### makefile but also in the header file src/Headers/local_constants.h
\r
67 ### directory for lclint libraries
\r
68 LIBDIR = \\\\usr\\\\lib\\\\lclint\\\\lib
\r
70 ### directory for lclint standard imports
\r
71 IMPORTSDIR = \\\\usr\\\\lib\\\\lclint\\\\imports
\r
73 ### these are automatically set:
\r
75 SYSTEM_IMPORTSDIR = "$(IMPORTSDIR)"
\r
76 SYSTEM_LARCHPATH = ".;$(LIBDIR)"
\r
78 ### directory for lclint binary
\r
79 INSTALLDIR = \\usr\\bin
\r
81 ### this should be the complete path for the directory where this
\r
82 ### Makefile is, with no trailing / or spaces.
\r
84 # BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION)
\r
91 ### I recommend doing this in an emacs shell (or buffered terminal) so
\r
92 ### you can scroll through the output.
\r
94 ### This should (hopefully) work on most systems without further changes.
\r
96 ### If you do not have gcc, set CC = cc (or some other compiler)
\r
97 ### later in this file.
\r
101 ### o put lclint in BASEDIR/bin/lclint
\r
103 ### If you have installed the test suite, then do:
\r
107 ### to verify lclint.
\r
111 ### If you wish to install lclint in some other directory, set these
\r
112 ### variables, and do
\r
117 ### installation command (I use emx GNUish utilities)
\r
127 ### end of installation variables
\r
131 ### compiler --- gcc is recommended, but lclint has been compiled
\r
132 ### without changes using cc on several platforms.
\r
135 # name of configuration:
\r
140 # compile commands:
\r
141 ifeq ($(COMPILER), gcc-emx)
\r
143 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
150 ifeq ($(COMPILER), gcc-os2)
\r
151 CC = gcc -Zsys -Zomf -O3
\r
152 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
155 LINKFLAGS = lclint.def -lfl
\r
159 ifeq ($(COMPILER), icc-os2)
\r
160 # Shame! Normally no warnings should be turned off, but IBM's are
\r
161 # so stupid they warn me about each llassert(). Let's check our
\r
162 # code using lclint then develop it on gcc and then move to IBMC...
\r
163 CC = icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+
\r
164 #CSet 2.01 needs this:
\r
166 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
\r
169 LINKFLAGS = -B/noe setargv.obj fl.lib lclint.def
\r
177 ### do you have bison and/or flex?
\r
178 ### (Note: yacc will probably not work; lex might work but is not recommended.)
\r
188 @$(ECHO) "Creating configuration file. Syntax error message can be ignored..."
\r
190 $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc
\r
192 @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..."
\r
194 $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=..\\src --warn-undefined-variables localconstants
\r
196 @$(ECHO) "Now building lclint executable file..."
\r
198 $(MAKE) -f Makefile.os2 --directory=..\\src --warn-undefined-variables
\r
200 @$(ECHO) "Now moving lclint executable file to bin directory..."
\r
202 @if not exist ..\\bin mkdir ..\\bin
\r
203 $(MV) ..\src\lclint$E ..\\bin\\lclint$E
\r
206 $(ECHO) "CC=$(CC)" >config.inc
\r
207 $(ECHO) "CFLAGS=$(CFLAGS)" >>config.inc
\r
208 $(ECHO) "CPPFLAGS=$(CPPFLAGS)" >>config.inc
\r
209 $(ECHO) "BISON=$(BISON)" >>config.inc
\r
210 $(ECHO) "FLEX=$(FLEX)" >>config.inc
\r
211 $(ECHO) "YFLAGS=$(YFLAGS)" >>config.inc
\r
212 $(ECHO) "LFLAGS=$(LFLAGS)" >>config.inc
\r
213 $(ECHO) "SYSTEM_LIBDIR=\"$(SYSTEM_LIBDIR)\"" >>config.inc
\r
214 $(ECHO) "DEFAULT_LCLIMPORTDIR=\"$(SYSTEM_IMPORTSDIR)\"" >>config.inc
\r
215 $(ECHO) "DEFAULT_LARCHPATH=\"$(SYSTEM_LARCHPATH)\"" >>config.inc
\r
216 $(ECHO) "DEFAULT_CPPCMD=\"$(CPPCMD)\"" >>config.inc
\r
217 $(ECHO) "LINKFLAGS=$(LINKFLAGS)" >>config.inc
\r
218 $(ECHO) "O=$O" >>config.inc
\r
219 $(ECHO) "E=$E" >>config.inc
\r
220 $(ECHO) "OFLAG=$(OFLAG)lclint$E" >>config.inc
\r
221 $(ECHO) "CAT=$(CAT)" >>config.inc
\r
222 $(ECHO) "MV=$(MV)" >>config.inc
\r
223 $(ECHO) "CP=$(CP)" >>config.inc
\r
224 $(ECHO) "ECHO=\"$(ECHO)\"" >>config.inc
\r
225 $(CP) ..\src\Headers\herald.h ..\src\Headers\herald.last
\r
226 $(ECHO) "/* herald.h - created automatically from herald.os2 and Makefile.os2 */" >..\src\Headers\herald.h
\r
227 $(ECHO) "/*@constant observer char *LCL_VERSION;@*/" >>..\src\Headers\herald.h
\r
228 $(ECHO) "# define LCL_VERSION \"LCLint $(LCL_VERSION) --- $(LCL_DATE)\"" >>..\src\Headers\herald.h
\r
229 $(ECHO) "/*@constant observer char *LCL_PARSE_VERSION;@*/" >>..\src\Headers\herald.h
\r
230 $(ECHO) "# define LCL_PARSE_VERSION \"LCLint $(LCL_VERSION)\"" >>..\src\Headers\herald.h
\r
231 $(ECHO) "/*@constant observer char *LCL_COMPILE;@*/" >>..\src\Headers\herald.h
\r
232 $(ECHO) "$(COMPILE_MSG)" >>..\src\Headers\herald.h
\r