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