]> andersk Git - splint.git/blame - os2/Makefile.os2
Added the FAQ and a document on using realloc to CVS.
[splint.git] / os2 / Makefile.os2
CommitLineData
e5a87a6c 1##################################################\r
2###\r
87fa79e5 3### Makefile for OS/2 version of splint\r
e5a87a6c 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
87fa79e5 26### builds a release version of splint from scratch using optimizations\r
e5a87a6c 27###\r
28### This makefile uses gmake, the gnu version of make.\r
29###\r
87fa79e5 30### Run gmake to build splint.\r
e5a87a6c 31### gmake install to install.\r
32###\r
33\r
87fa79e5 34SHELL=/usr/bin/ksh\r
e5a87a6c 35\r
e5a87a6c 36\r
87fa79e5 37###\r
38### This needs to be configured:\r
39###\r
e5a87a6c 40\r
41### Directory containing system include files:\r
42\r
87fa79e5 43SYSTEM_LIBDIR = e:/usr/include\r
e5a87a6c 44\r
45### default preprocessor command:\r
46\r
87fa79e5 47CPPCMD = cpp \r
48\r
49### directory for splint standard imports\r
50DEFAULT_LCLIMPORTDIR = .;e:/usr/lib/splint/imports\r
51\r
52### directory for splint libraries\r
53DEFAULT_LARCHPATH = .;e:/usr/lib/splint/lib\r
54\r
55### directory for splint binary\r
56INSTALLDIR = e:/usr/bin\r
57\r
58### system include directory\r
59GCC_INCLUDE_DIR = e:/usr/include\r
60\r
61### alternate system include directory\r
62GCC_INCLUDE_DIR2 = e:/emx/include\r
e5a87a6c 63\r
64###\r
87fa79e5 65### Cosmetic stuff (goes into the executable\r
e5a87a6c 66###\r
e5a87a6c 67\r
87fa79e5 68LCL_OS2 = 1\r
69TARGET_CPU = i586\r
70UNAME = OS/2 Warp 4 (Paulina)\r
e5a87a6c 71\r
87fa79e5 72###\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
75###\r
e5a87a6c 76\r
87fa79e5 77BISON = bison\r
78FLEX = flex\r
79YFLAGS = -v -t -d\r
80LFLAGS =\r
e5a87a6c 81\r
149b00db 82###\r
83### file-related commands (I use emx GNUish utilities)\r
84###\r
85CP = cp\r
86MV = mv\r
87CAT = cat\r
88RM = rm\r
89INSTALL = cp\r
90INSTALLFLAGS = \r
91ECHO = echo\r
92SED = sed\r
93\r
87fa79e5 94###\r
95### Set automatically: splint version and date etc.\r
96###\r
e5a87a6c 97\r
149b00db 98LCL_VERSION := $(shell grep "^VERSION" ../configure | $(SED) "s/VERSION *= *//")\r
87fa79e5 99LCL_DATE := $(shell date +"%d %b %Y")\r
100BUILD_DATE := $(shell date +"%c")\r
101ME := $(shell whoami)\r
102BASEDIR := $(shell (cd ..; cmd /c cd | tr '\\' '/'))\r
e5a87a6c 103\r
87fa79e5 104LCL_COMPILE = Compiled using $(CC)\\n on $(UNAME) $(TARGET_CPU) $(BUILD_DATE) by $(ME),\\n OS/2 specific subversion is $(LCL_OS2)\r
105LCL_PARSE_VERSION = Splint $(LCL_VERSION)\r
106SPLINT_VERSION = $(LCL_PARSE_VERSION) -- $(LCL_DATE)\r
e5a87a6c 107\r
e5a87a6c 108\r
e5a87a6c 109###\r
87fa79e5 110### compiler --- gcc is recommended, but splint has been compiled\r
e5a87a6c 111### without changes using cc on several platforms.\r
112###\r
113\r
114# name of configuration:\r
115COMPILER=gcc-emx\r
116#COMPILER=gcc-os2\r
117#COMPILER=icc-os2\r
118\r
119# compile commands:\r
120ifeq ($(COMPILER), gcc-emx)\r
121 CC = gcc -g\r
122 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2\r
123 CFLAGS=-Wall \r
124 OFLAG=-o \r
87fa79e5 125 LDFLAGS = -lfl\r
e5a87a6c 126 O=.o\r
87fa79e5 127 EXEEXT=.exe\r
e5a87a6c 128else\r
129 ifeq ($(COMPILER), gcc-os2)\r
130 CC = gcc -Zsys -Zomf -O3\r
131 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2\r
132 CFLAGS=-Wall \r
133 OFLAG=-o \r
87fa79e5 134 LDFLAGS = splint.def -lfl\r
e5a87a6c 135 O=.obj\r
87fa79e5 136 EXEEXT=.exe\r
e5a87a6c 137 else\r
138 ifeq ($(COMPILER), icc-os2)\r
139 # Shame! Normally no warnings should be turned off, but IBM's are\r
140 # so stupid they warn me about each llassert(). Let's check our\r
87fa79e5 141 # code using splint then develop it on gcc and then move to IBMC...\r
e5a87a6c 142 CC = icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+ \r
143 #CSet 2.01 needs this:\r
144 #-D__STDC__\r
145 CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 \r
146 CFLAGS=\r
147 OFLAG=-fe\r
87fa79e5 148 LDFLAGS = -B/noe setargv.obj fl.lib splint.def\r
e5a87a6c 149 O=.obj\r
87fa79e5 150 EXEEXT=.exe\r
e5a87a6c 151 endif\r
152 endif\r
153endif\r
154\r
87fa79e5 155.PHONY: all clean config confclean\r
156\r
157all: make.vars ../config.h setenv.cmd\r
158 $(MAKE) --directory=../src -f Makefile.os2 all\r
159 $(MAKE) --directory=../lib -f Makefile.os2 all\r
160\r
161make.vars:\r
162 echo "CC = $(CC)" >make.vars\r
163 echo "CPPFLAGS = $(CPPFLAGS)" >>make.vars\r
164 echo "CFLAGS = $(CFLAGS)" >>make.vars\r
165 echo "OFLAG = $(OFLAG)" >>make.vars\r
166 echo "LDFLAGS = $(LDFLAGS)" >>make.vars\r
167 echo "O = $(O)" >>make.vars\r
168 echo "EXEEXT = $(EXEEXT)" >>make.vars\r
169 echo "BISON = $(BISON)" >>make.vars\r
170 echo "FLEX = $(FLEX)" >>make.vars\r
171 echo "YFLAGS = $(YFLAGS)" >>make.vars\r
172 echo "LFLAGS = $(LFLAGS)" >>make.vars\r
173 echo "CPPCMD = $(CPPCMD)" >>make.vars\r
174 echo "CP = $(CP)" >>make.vars\r
175 echo "MV = $(MV)" >>make.vars\r
176 echo "CAT = $(CAT)" >>make.vars\r
177 echo "RM = $(RM)" >>make.vars\r
178 echo "INSTALL = $(INSTALL)" >>make.vars\r
179 echo "INSTALLFLAGS = $(INSTALLFLAGS)" >>make.vars\r
180 echo "ECHO = $(ECHO)" >>make.vars\r
149b00db 181 echo "SED = $(SED)" >>make.vars\r
87fa79e5 182\r
183../config.h: os2config.h.in\r
149b00db 184 $(SED) -e 's|@DEFAULT_LARCHPATH@|$(DEFAULT_LARCHPATH)|' \\r
87fa79e5 185 -e 's|@DEFAULT_LCLIMPORTDIR@|$(DEFAULT_LCLIMPORTDIR)|' \\r
186 -e 's|@GCC_INCLUDE_DIR@|$(GCC_INCLUDE_DIR)|' \\r
187 -e 's|@GCC_INCLUDE_DIR2@|$(GCC_INCLUDE_DIR2)|' \\r
188 -e 's|@TARGET_CPU@|$(TARGET_CPU)|' \\r
189 -e 's|@UNAME@|$(UNAME)|' \\r
190 -e 's|@LCL_COMPILE@|$(LCL_COMPILE)|' \\r
191 -e 's|@LCL_PARSE_VERSION@|$(LCL_PARSE_VERSION)|' \\r
192 -e 's|@SPLINT_VERSION@|$(SPLINT_VERSION)|' \\r
193 -e 's|@SYSTEM_LIBDIR@|$(SYSTEM_LIBDIR)|' \\r
194 os2config.h.in >../config.h\r
195\r
196setenv.cmd: setenv.cmd.in\r
149b00db 197 $(SED) -e 's|@LCL_VERSION@|$(LCL_VERSION)|' \\r
87fa79e5 198 -e 's|@BASEDIR@|$(BASEDIR)|' \\r
199 setenv.cmd.in | tr '/' '\\\\' >setenv.cmd\r
200\r
201config: make.vars ../config.h setenv.cmd\r
202\r
203confclean:\r
204 $(RM) -f make.vars ../config.h setenv.cmd\r
205\r
206clean: confclean\r
207 $(MAKE) --directory=../src -f Makefile.os2 clean\r
208 $(MAKE) --directory=../lib -f Makefile.os2 clean\r
This page took 0.11703 seconds and 5 git commands to generate.