]> andersk Git - splint.git/blob - os2/Makefile.os2
hopefully with crlfs now
[splint.git] / os2 / Makefile.os2
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
39 LCL_DATE=25 Sep 2001\r
40 \r
41 # this gets written into the binary, add your name, your compiler settings\r
42 #  etc. if you like.\r
43 TODAY=Monday 25 Sep 19:40 MEST 2001\r
44 ME=herbert\r
45 MACHINE=i586\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
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
84 BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION)\r
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
186 ###\r
187 ### is the test suite available? (must be full path here)\r
188 ###\r
189 \r
190 TESTDIR   = $(BASEDIR)/test\r
191 \r
192 ### \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
196 ###\r
197 \r
198 .PHONY: install dobinaries dolibraries doimports test \r
199 \r
200 ###\r
201 ### set this to a different directory\r
202 ### to install binaries elsewhere\r
203 ###\r
204 \r
205 RELEASEDIR      = $(BASEDIR)/bin\r
206 \r
207 all: \r
208         @$(ECHO)\r
209         @$(ECHO) "Creating configuration file. Syntax error message can be ignored..."\r
210         @$(ECHO)\r
211         $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc  \r
212         @$(ECHO)\r
213         @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..."\r
214         @$(ECHO)\r
215         $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables localconstants \r
216         @$(ECHO)\r
217         @$(ECHO) "Now building lclint executable file..."\r
218         @$(ECHO)\r
219         $(MAKE) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables\r
220         @$(ECHO)\r
221         @$(ECHO) "Now moving lclint executable file to bin directory..."\r
222         @$(ECHO)\r
223         $(MV) $(BASEDIR)\src\lclint$E $(RELEASEDIR)\lclint$E\r
224 \r
225 configinc:\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
253 \r
254 ###\r
255 ### locations of standard LCLint files\r
256 ###\r
257 ### this should NOT have to be edited if you use the standard\r
258 ###    installation package\r
259 \r
260 LCLINTBINDIR = $(BASEDIR)/bin\r
261 \r
262 LCLINTLIB = $(BASEDIR)/lib\r
263 LCLINTIMPORTS = $(BASEDIR)/imports\r
264 \r
265 ###\r
266 ### uses recursive make calls directly, so installation\r
267 ### will continue even if there are errors!\r
268 ###\r
269 \r
270 install: \r
271         $(MAKE) dobinaries   -f Makefile.os2\r
272         $(MAKE) dolibraries  -f Makefile.os2\r
273         $(MAKE) doimports    -f Makefile.os2\r
274 \r
275 dobinaries:\r
276         $(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR)\r
277 \r
278 dolibraries:\r
279         -mkdir$E $(LIBDIR)\r
280         $(CP) $(LCLINTLIB)\\* $(LIBDIR)\r
281 \r
282 doimports:\r
283         -mkdir$E $(IMPORTSDIR)\r
284         $(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR)\r
285 \r
This page took 0.072871 seconds and 5 git commands to generate.