]>
Commit | Line | Data |
---|---|---|
e5a87a6c | 1 | ##################################################\r |
2 | ###\r | |
3 | ### Makefile for OS/2 version of LCLint\r | |
4 | ###\r | |
5 | ### designed for use with gmake (GNU make)\r | |
6 | ###\r | |
7 | ### based on David Evans' original makefile for Unix systems automatically\r | |
8 | ### generated by configure on a Linux system.\r | |
9 | ###\r | |
10 | ### configuration is set here and written to file config.inc included by\r | |
11 | ### other makefiles\r | |
12 | ###\r | |
13 | ### supported compilers are:\r | |
14 | ### emx/gcc\r | |
15 | ### IBM VisualAge C++ 3.0\r | |
16 | ###\r | |
17 | ### other system requirements:\r | |
18 | ### HPFS filesystem (long filenames).\r | |
19 | ###\r | |
20 | ### *NOTE*, before running "make" edit this file to fit your local settings!\r | |
21 | ### ========================================================================\r | |
22 | ###\r | |
23 | ### Commands:\r | |
24 | ###\r | |
25 | ### make all\r | |
26 | ### builds a release version of lclint from scratch using optimizations\r | |
27 | ###\r | |
28 | ### This makefile uses gmake, the gnu version of make.\r | |
29 | ###\r | |
30 | ### Run gmake to build LCLint.\r | |
31 | ### gmake install to install.\r | |
32 | ###\r | |
33 | \r | |
34 | ###\r | |
35 | ### lclint version and date:\r | |
36 | ###\r | |
37 | \r | |
38 | LCL_VERSION=3.0.0.16\r | |
3934e170 | 39 | LCL_DATE=28 Sep 2001\r |
e5a87a6c | 40 | \r |
41 | # this gets written into the binary, add your name, your compiler settings\r | |
42 | # etc. if you like.\r | |
3934e170 | 43 | TODAY=Monday 28 Sep 23:43 MEST 2001\r |
e5a87a6c | 44 | ME=herbert\r |
45 | MACHINE=i586\r | |
3934e170 | 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 |
e5a87a6c | 47 | \r |
48 | ### Directory containing system include files:\r | |
49 | \r | |
50 | SYSTEM_LIBDIR = "\\\\usr\\\\include"\r | |
51 | \r | |
52 | ### default preprocessor command:\r | |
53 | \r | |
54 | CPPCMD = "cpp "\r | |
55 | \r | |
56 | ###\r | |
57 | ### Select installation directories:\r | |
58 | ###\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 | |
62 | ###\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 | |
65 | ### \r | |
66 | \r | |
67 | ### directory for lclint libraries\r | |
68 | LIBDIR = \\\\usr\\\\lib\\\\lclint\\\\lib\r | |
69 | \r | |
70 | ### directory for lclint standard imports\r | |
71 | IMPORTSDIR = \\\\usr\\\\lib\\\\lclint\\\\imports\r | |
72 | \r | |
73 | ### these are automatically set:\r | |
74 | \r | |
75 | SYSTEM_IMPORTSDIR = "$(IMPORTSDIR)"\r | |
76 | SYSTEM_LARCHPATH = ".;$(LIBDIR)"\r | |
77 | \r | |
78 | ### directory for lclint binary\r | |
79 | INSTALLDIR = \\usr\\bin\r | |
80 | \r | |
81 | ### this should be the complete path for the directory where this\r | |
82 | ### Makefile is, with no trailing / or spaces.\r | |
83 | \r | |
3934e170 | 84 | # BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION)\r |
e5a87a6c | 85 | \r |
86 | ###\r | |
87 | ### Then, run:\r | |
88 | ###\r | |
89 | ### make\r | |
90 | ###\r | |
91 | ### I recommend doing this in an emacs shell (or buffered terminal) so\r | |
92 | ### you can scroll through the output.\r | |
93 | ###\r | |
94 | ### This should (hopefully) work on most systems without further changes.\r | |
95 | ###\r | |
96 | ### If you do not have gcc, set CC = cc (or some other compiler)\r | |
97 | ### later in this file. \r | |
98 | ###\r | |
99 | ### It should:\r | |
100 | ### o build lclint\r | |
101 | ### o put lclint in BASEDIR/bin/lclint\r | |
102 | ###\r | |
103 | ### If you have installed the test suite, then do:\r | |
104 | ###\r | |
105 | ### make test\r | |
106 | ###\r | |
107 | ### to verify lclint.\r | |
108 | ###\r | |
109 | \r | |
110 | ###\r | |
111 | ### If you wish to install lclint in some other directory, set these \r | |
112 | ### variables, and do \r | |
113 | ###\r | |
114 | ### make install\r | |
115 | ###\r | |
116 | \r | |
117 | ### installation command (I use emx GNUish utilities)\r | |
118 | CP = cp\r | |
119 | MV = mv\r | |
120 | CAT = type\r | |
121 | RM = rm\r | |
122 | INSTALL = cp\r | |
123 | INSTALLFLAGS = \r | |
124 | ECHO = "echo.exe"\r | |
125 | \r | |
126 | ###\r | |
127 | ### end of installation variables\r | |
128 | ###\r | |
129 | \r | |
130 | ###\r | |
131 | ### compiler --- gcc is recommended, but lclint has been compiled\r | |
132 | ### without changes using cc on several platforms.\r | |
133 | ###\r | |
134 | \r | |
135 | # name of configuration:\r | |
136 | COMPILER=gcc-emx\r | |
137 | #COMPILER=gcc-os2\r | |
138 | #COMPILER=icc-os2\r | |
139 | \r | |
140 | # compile commands:\r | |
141 | ifeq ($(COMPILER), gcc-emx)\r | |
142 | CC = gcc -g\r | |
143 | CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2\r | |
144 | CFLAGS=-Wall \r | |
145 | OFLAG=-o \r | |
146 | LINKFLAGS = -lfl\r | |
147 | O=.o\r | |
148 | E=.exe\r | |
149 | else\r | |
150 | ifeq ($(COMPILER), gcc-os2)\r | |
151 | CC = gcc -Zsys -Zomf -O3\r | |
152 | CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2\r | |
153 | CFLAGS=-Wall \r | |
154 | OFLAG=-o \r | |
155 | LINKFLAGS = lclint.def -lfl\r | |
156 | O=.obj\r | |
157 | E=.exe\r | |
158 | else\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 | |
165 | #-D__STDC__\r | |
166 | CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 \r | |
167 | CFLAGS=\r | |
168 | OFLAG=-fe\r | |
169 | LINKFLAGS = -B/noe setargv.obj fl.lib lclint.def\r | |
170 | O=.obj\r | |
171 | E=.exe\r | |
172 | endif\r | |
173 | endif\r | |
174 | endif\r | |
175 | \r | |
176 | ###\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 | |
179 | ###\r | |
180 | \r | |
181 | BISON = bison\r | |
182 | FLEX = flex\r | |
183 | YFLAGS = -v -t -d\r | |
184 | LFLAGS =\r | |
185 | \r | |
e5a87a6c | 186 | all: \r |
187 | @$(ECHO)\r | |
188 | @$(ECHO) "Creating configuration file. Syntax error message can be ignored..."\r | |
189 | @$(ECHO)\r | |
190 | $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc \r | |
191 | @$(ECHO)\r | |
192 | @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..."\r | |
193 | @$(ECHO)\r | |
3934e170 | 194 | $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=..\\src --warn-undefined-variables localconstants \r |
e5a87a6c | 195 | @$(ECHO)\r |
196 | @$(ECHO) "Now building lclint executable file..."\r | |
197 | @$(ECHO)\r | |
3934e170 | 198 | $(MAKE) -f Makefile.os2 --directory=..\\src --warn-undefined-variables\r |
e5a87a6c | 199 | @$(ECHO)\r |
200 | @$(ECHO) "Now moving lclint executable file to bin directory..."\r | |
201 | @$(ECHO)\r | |
3934e170 | 202 | @if not exist ..\\bin mkdir ..\\bin\r |
203 | $(MV) ..\src\lclint$E ..\\bin\\lclint$E\r | |
e5a87a6c | 204 | \r |
205 | configinc:\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 | |
3934e170 | 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 | |
e5a87a6c | 233 | \r |