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=25 Sep 2001
\r
41 # this gets written into the binary, add your name, your compiler settings
\r
43 TODAY=Monday 25 Sep 19:40 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 4\"
\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
187 ### is the test suite available? (must be full path here)
\r
190 TESTDIR = $(BASEDIR)/test
\r
193 ### if this Makefile is used with one of the
\r
194 ### standard installation packages, no changes should be
\r
195 ### necessary below this line.
\r
198 .PHONY: install dobinaries dolibraries doimports test
\r
201 ### set this to a different directory
\r
202 ### to install binaries elsewhere
\r
205 RELEASEDIR = $(BASEDIR)/bin
\r
209 @$(ECHO) "Creating configuration file. Syntax error message can be ignored..."
\r
211 $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc
\r
213 @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..."
\r
215 $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables localconstants
\r
217 @$(ECHO) "Now building lclint executable file..."
\r
219 $(MAKE) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables
\r
221 @$(ECHO) "Now moving lclint executable file to bin directory..."
\r
223 $(MV) $(BASEDIR)\src\lclint$E $(RELEASEDIR)\lclint$E
\r
226 $(ECHO) "CC=$(CC)" >config.inc
\r
227 $(ECHO) "CFLAGS=$(CFLAGS)" >>config.inc
\r
228 $(ECHO) "CPPFLAGS=$(CPPFLAGS)" >>config.inc
\r
229 $(ECHO) "BISON=$(BISON)" >>config.inc
\r
230 $(ECHO) "FLEX=$(FLEX)" >>config.inc
\r
231 $(ECHO) "YFLAGS=$(YFLAGS)" >>config.inc
\r
232 $(ECHO) "LFLAGS=$(LFLAGS)" >>config.inc
\r
233 $(ECHO) "SYSTEM_LIBDIR=\"$(SYSTEM_LIBDIR)\"" >>config.inc
\r
234 $(ECHO) "DEFAULT_LCLIMPORTDIR=\"$(SYSTEM_IMPORTSDIR)\"" >>config.inc
\r
235 $(ECHO) "DEFAULT_LARCHPATH=\"$(SYSTEM_LARCHPATH)\"" >>config.inc
\r
236 $(ECHO) "DEFAULT_CPPCMD=\"$(CPPCMD)\"" >>config.inc
\r
237 $(ECHO) "LINKFLAGS=$(LINKFLAGS)" >>config.inc
\r
238 $(ECHO) "O=$O" >>config.inc
\r
239 $(ECHO) "E=$E" >>config.inc
\r
240 $(ECHO) "OFLAG=$(OFLAG)lclint$E" >>config.inc
\r
241 $(ECHO) "CAT=$(CAT)" >>config.inc
\r
242 $(ECHO) "MV=$(MV)" >>config.inc
\r
243 $(ECHO) "CP=$(CP)" >>config.inc
\r
244 $(ECHO) "ECHO=\"$(ECHO)\"" >>config.inc
\r
245 $(CP) $(BASEDIR)\src\Headers\herald.h $(BASEDIR)\src\Headers\herald.last
\r
246 $(ECHO) "/* herald.h - created automatically from herald.os2 and Makefile.os2 */" >$(BASEDIR)\src\Headers\herald.h
\r
247 $(ECHO) "/*@constant observer char *LCL_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h
\r
248 $(ECHO) "# define LCL_VERSION \"LCLint $(LCL_VERSION) --- $(LCL_DATE)\"" >>$(BASEDIR)\src\Headers\herald.h
\r
249 $(ECHO) "/*@constant observer char *LCL_PARSE_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h
\r
250 $(ECHO) "# define LCL_PARSE_VERSION \"LCLint $(LCL_VERSION)\"" >>$(BASEDIR)\src\Headers\herald.h
\r
251 $(ECHO) "/*@constant observer char *LCL_COMPILE;@*/" >>$(BASEDIR)\src\Headers\herald.h
\r
252 $(ECHO) "$(COMPILE_MSG)" >>$(BASEDIR)\src\Headers\herald.h
\r
255 ### locations of standard LCLint files
\r
257 ### this should NOT have to be edited if you use the standard
\r
258 ### installation package
\r
260 LCLINTBINDIR = $(BASEDIR)/bin
\r
262 LCLINTLIB = $(BASEDIR)/lib
\r
263 LCLINTIMPORTS = $(BASEDIR)/imports
\r
266 ### uses recursive make calls directly, so installation
\r
267 ### will continue even if there are errors!
\r
271 $(MAKE) dobinaries -f Makefile.os2
\r
272 $(MAKE) dolibraries -f Makefile.os2
\r
273 $(MAKE) doimports -f Makefile.os2
\r
276 $(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR)
\r
280 $(CP) $(LCLINTLIB)\\* $(LIBDIR)
\r
283 -mkdir$E $(IMPORTSDIR)
\r
284 $(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR)
\r