]> andersk Git - splint.git/blame - Makefile.in
Changed BADBRANCH to avoid gcc warnings.
[splint.git] / Makefile.in
CommitLineData
885824d3 1###
2### Makefile for building and installing LCLint 2.5
3###
4### Updated for LCLint 2.5: 23 May 2000
5### Updated for LCLint 2.4: 12 April 1998
6### Updated for LCLint 2.2: 25 August 1996
7### Updated for LCLint 2.1a: 17 April 1996
8### Updated for LCLint 2.0: 24 February 1996
9### Updated for LCLint 1.4: 29 January 1995
10### Original for LCLint 1.0: 20 February 1994
11###
12
13###
14### This makefile assumes the gnu version of make is available.
15###
16### Run: make to build LCLint.
17### make install to install.
18###
19###
20### These constants will be compiled into the lclint binary.
21###
22### They may be overridden by environment variables, but these
23### constants set the default values when no environment variables
24### are set.
25###
26
27### Command to run C preprocessor:
28
29DEFAULT_CPPCMD = @CPP@
30
31### Directory containing system include files:
32
33SYSTEM_LIBDIR = "/usr/include"
34
35###
36### Select installation directories:
37###
38### The LIBDIR and IMPORTSDIR are compiled into the binary to
39### select the default LARCH_PATH and LCLIMPORTDIR, which can
40### also be overridden by environment variables.
41###
42
43### directory for lclint libraries
44LIBDIR = @installdir@/lib
45
46### directory for lclint standard imports
47IMPORTSDIR = @installdir@/imports
48
49### directory for lclint binary
50INSTALLDIR = @installdir@/bin
51
52### this should be the complete path for the directory where this
53### Makefile is, with no trailing / or spaces.
54
55BASEDIR = @cwdir@
56
57###
58### Then, run:
59###
60### make
61###
62### I recommend doing this in an emacs shell (or buffered terminal) so
63### you can scroll through the output.
64###
65### This should (hopefully) work on most systems without further changes.
66###
67### If you do not have gcc, set CC = cc (or some other compiler)
68### later in this file.
69###
70### It should:
71### o build lclint
72### o put lclint in BASEDIR/bin/lclint
73###
74### If you have installed the test suite, then do:
75###
76### make test
77###
78### to verify lclint.
79###
80
81###
82### shell --- should work with /bin/sh or similar shells too.
83###
84
85SHELL = /bin/csh
86
87###
88### If you wish to install lclint in some other directory, set these
89### variables, and do
90###
91### make install
92###
93
94### installation command
95INSTALL = @INSTALL@
96INSTALLFLAGS =
97
98### this works with nfs, change to whatever is needed to make
99### a file executable on your system
100
101MAKEEXE = chmod 755
102
103###
104### end of installation variables
105###
106
107###
108### compiler --- gcc is recommended, but lclint has been compiled
109### without changes using cc on several platforms.
110###
111
112CC = @CC@ @DEFS@
113
114###
115### optimizing compiler --- add optimization flags here
116###
117
118CCOPT = $(CC) @OPT@
119
120###
121### link flags --- this links the lex or flex library
122###
123
124LINKFLAGS = @LINKLEX@
125
126###
127### do you have bison and/or flex?
128### (Note: yacc will probably not work; lex might work but is not recommended.)
129###
130
131BISON = @BISON@
132FLEX = @FLEX@
133
134###
135### is the test suite available? (must be full path here)
136###
137
138TESTDIR = $(BASEDIR)/test
139
140###
141### if this Makefile is used with one of the
142### standard installation packages, no changes should be
143### necessary below this line.
144###
145
146.PHONY: install dobinaries dolibraries doimports test
147
148###
149### set this to a different directory
150### to install binaries elsewhere
151###
152
153RELEASEDIR = $(BASEDIR)/bin
154
155all: bin/lclint
156lclint: bin/lclint
157
158bin/lclint:
159 @echo 'Building lclint from source'
160ifeq ($(SHELL), /bin/csh)
161 cd src ; setenv CC '$(CC)' ; setenv CCOPT '$(CCOPT)'; \
162 setenv BISON '$(BISON)' ; setenv FLEX '$(FLEX)' ; \
163 setenv DEFAULT_CPPCMD '"$(DEFAULT_CPPCMD)"' ; \
164 setenv SYSTEM_LIBDIR '$(SYSTEM_LIBDIR)' ; \
165 setenv LINKFLAGS '$(LINKFLAGS)' ; \
166 setenv DEFAULT_LARCHPATH '".:$(LIBDIR)"' ; \
167 setenv DEFAULT_LCLIMPORTDIR '"$(IMPORTSDIR)"' ; \
168 $(MAKE) -e
169else
170 cd src ; CC='$(CC)'; export CC; CCOPT='$(CCOPT)'; \
171 BISON='$(BISON)' ; export BISON; FLEX='$(FLEX)'; export FLEX; \
172 DEFAULT_CPPCMD='$(DEFAULT_CPPCMD)' ; export DEFAULT_CPPCMD ;\
173 SYSTEM_LIBDIR='$(SYSTEM_LIBDIR)' ; export SYSTEM_LIBDIR ;\
174 DEFAULT_LARCHPATH='".:$(LIBDIR)/"' ; export DEFAULT_LARCHPATH ;\
3fbe4d60 175 LINKFLAGS='$(LINKFLAGS)'; export LINKFLAGS; \
885824d3 176 DEFAULT_LCLIMPORTDIR='"$(IMPORTSDIR)"' ; export DEFAULT_LCLIMPORTDIR ;\
177 $(MAKE) -e
178endif
179 @echo '// '
180 @echo '// Run: '$(MAKE)' test to check'
181 @echo '// '
de2f94c0 182 -mkdir bin
885824d3 183 mv src/lclint bin/lclint
184
185test:
186ifeq ($(SHELL), /bin/csh)
187 cd $(TESTDIR) ; setenv LCLINT $(RELEASEDIR)/lclint ; $(MAKE) -e
188else
189 cd $(TESTDIR) ; LCLINT=$(RELEASEDIR)/lclint ; export LCLINT ; $(MAKE) -e
190endif
191
192clean:
193 cd src; $(MAKE) clean
194 rm bin/lclint
195
196###
197### locations of standard LCLint files
198###
199### this should NOT have to be edited if you use the standard
200### installation package
201
202CP = cp
203
204LCLINTBINDIR = $(BASEDIR)/bin
205LCLINTBIN = lclint
206
207LCLINTLIB = $(BASEDIR)/lib
208LCLINTIMPORTS = $(BASEDIR)/imports
209
210###
211### uses recursive make calls directly, so installation
212### will continue even if there are errors!
213###
214
215install:
216 @echo '// '
217 @echo '// Doing lclint installation'
218 @echo '// '
219 @echo ' '
220 -@$(MAKE) dobinaries
221 @echo ' '
222 -@$(MAKE) dolibraries
223 @echo ' '
224 -@$(MAKE) doimports
225 @echo ' '
226 @echo '// Installation complete.'
227
228dobinaries:
229 @echo '// Installing binaries in '$(INSTALLDIR)
230 cd $(LCLINTBINDIR); $(INSTALL) $(INSTALLFLAGS) lclint $(INSTALLDIR)
231 @echo '// Installed: lclint in '$(INSTALLDIR)
232
233dolibraries:
234 @echo '// Installing libraries in '$(LIBDIR)
235 @echo " (This will complain if the directory already exists, don't worry about it.)"
236 -mkdir $(LIBDIR)
237 $(CP) $(LCLINTLIB)/* $(LIBDIR)
238 @echo '// Installed libraries.'
239
240doimports:
241 @echo '// Installing imports in '$(IMPORTSDIR)
242 @echo " (This will complain if the directory already exists, don't worry about it.)"
243 -mkdir $(IMPORTSDIR)
244 $(CP) $(LCLINTIMPORTS)/* $(IMPORTSDIR)
245 @echo '// Installed imports.'
246
247
248
249
250
251
252
253
254
255
256
257
This page took 0.228027 seconds and 5 git commands to generate.