home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lclint.zip
/
lclint-2_3h-os2-bin.zip
/
build
/
Makefile.os2
Wrap
Makefile
|
1997-09-12
|
7KB
|
287 lines
##################################################
###
### Makefile for OS/2 version of LCLint
###
### designed for use with gmake (GNU make)
###
### based on David Evans' original makefile for Unix systems automatically
### generated by configure on a Linux system.
###
### configuration is set here and written to file config.inc included by
### other makefiles
###
### supported compilers are:
### emx/gcc
### IBM CSet++ 2.1
###
### other system requirements:
### HPFS filesystem (long filenames).
###
### *NOTE*, before running "make" edit this file to fit your local settings!
### ========================================================================
###
### Commands:
###
### make all
### builds a release version of lclint from scratch using optimizations
###
### This makefile uses gmake, the gnu version of make.
###
### Run gmake to build LCLint.
### gmake install to install.
###
###
### lclint version and date:
###
LCL_VERSION=2.3h
LCL_DATE=03 Sep 97
###
### Personal stuff:
###
# this gets written into the binary, add your name, your compiler settings
# etc. if you like.
TODAY=Thursday 12 September 12:12 MEST 1997
ME=herbert
MACHINE=i586
COMPILE_MSG=\# define LCL_COMPILE "Compiled using $(CC)\n on OS/2 $(TODAY) $(MACHINE) by $(ME),\n OS/2 specific subversion is 2"
###
### the following variables will have to be configured to fit
### local settings:
###
### Directory containing system include files:
SYSTEM_LIBDIR = "\\usr\\include"
### default preprocessor command:
CPPCMD = "cpp "
###
### Select installation directories:
###
### The LIBDIR and IMPORTSDIR are compiled into the binary to
### select the default LARCH_PATH and LCLIMPORTDIR, which can
### also be overridden by environment variables.
###
### It may be a good idea to edit these variables not only in this
### makefile but also in the header file src/Headers/local_constants.h
###
### directory for lclint libraries
LIBDIR = \\usr\\lib\\lclint\\lib
### directory for lclint standard imports
IMPORTSDIR = \\usr\\lib\\lclint\\imports
### these are automatically set:
SYSTEM_IMPORTSDIR = "$(IMPORTSDIR)"
SYSTEM_LARCHPATH = ".;$(LIBDIR)"
###
### More local variables needed for doing "make install"
###
### directory for lclint binary
INSTALLDIR = \usr\bin
### directory for installing lclint.el[c]
EMACSLIBDIR = \emacs\site-lisp
### this should be the complete path for the directory where this
### Makefile is, with no trailing \ or spaces.
BASEDIR = \usr\src\lclint-2.2a
###
### Commands settings (compiler etc.)
###
### Shell-commands:
CP = copy
INSTALL = copy
CAT = type
MV = mv
INSTALLFLAGS =
###
### compiler --- gcc is recommended, but lclint has been compiled
### without changes using cc on several platforms.
###
# name of configuration:
#COMPILER=gcc-emx
#COMPILER=gcc-os2
COMPILER=icc-os2
# compile commands:
ifeq ($(COMPILER), gcc-emx)
CC = gcc -O3
CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
CFLAGS=
OFLAG=-o
LINKFLAGS = -lfl
O=.o
E=.exe
else
ifeq ($(COMPILER), gcc-os2)
CC = gcc -Zsys -Zomf -O3
CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
CFLAGS=
OFLAG=-o
LINKFLAGS = lclint.def -lfl
O=.obj
E=.exe
else
ifeq ($(COMPILER), icc-os2)
CC = icc -q -Dunlink=unlink -D__STDC__ -O+ -G5 -Gf+ -Gi+ -Gs+
CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2
CFLAGS=
OFLAG=-fe
LINKFLAGS = ..\libfl\fl.lib lclint.def
O=.obj
E=.exe
endif
endif
endif
###
### do you have bison and/or flex?
### (Note: yacc will probably not work; lex might work but is not recommended.)
###
BISON = bison
FLEX = flex
YFLAGS = -v -t -d
LFLAGS =
###
### if this Makefile is used with one of the
### standard installation packages, no changes should be
### necessary below this line.
###
.PHONY: install dobinaries dolibraries doimports doemacs
###
### set this to a different directory
### to install binaries elsewhere
###
RELEASEDIR = $(BASEDIR)\bin
all: bin\lclint$E
lclint: bin\lclint$E
bin\lclint$E:
@cmd /c echo.
@echo Creating configuration file. Syntax error message can be ignored...
@cmd /c echo.
$(MAKE) -f Makefile.os2 --warn-undefined-variables configinc
@cmd /c echo.
@echo Creating local constants header file. Syntax error messages can be ignored...
@cmd /c echo.
$(MAKE) -f Makefile.os2 --directory=src --warn-undefined-variables localconstants
@cmd /c echo.
@echo Now building lclint executable file...
@cmd /c echo.
$(MAKE) -f Makefile.os2 --directory=src --warn-undefined-variables
@cmd /c echo.
@echo Now moving lclint executable file to bin directory...
@cmd /c echo.
mv src\lclint$E bin\lclint$E
configinc:
echo CC=$(CC) >config.inc
echo CFLAGS=$(CFLAGS) >>config.inc
echo CPPFLAGS=$(CPPFLAGS) >>config.inc
echo BISON=$(BISON) >>config.inc
echo FLEX=$(FLEX) >>config.inc
echo YFLAGS=$(YFLAGS) >>config.inc
echo LFLAGS=$(LFLAGS) >>config.inc
echo SYSTEM_LIBDIR=$(SYSTEM_LIBDIR) >>config.inc
echo DEFAULT_LCLIMPORTDIR=$(SYSTEM_IMPORTSDIR) >>config.inc
echo DEFAULT_LARCHPATH=$(SYSTEM_LARCHPATH) >>config.inc
echo DEFAULT_CPPCMD=$(CPPCMD) >>config.inc
echo LINKFLAGS=$(LINKFLAGS) >>config.inc
echo O=$O >>config.inc
echo E=$E >>config.inc
echo OFLAG=$(OFLAG)lclint$E >>config.inc
echo CAT=$(CAT) >>config.inc
echo MV=$(MV) >>config.inc
$(CP) src\Headers\herald.h src\Headers\herald.last
echo /* herald.h - created automatically from herald.os2 and Makefile.os2 */ >src\Headers\herald.h
echo /*@constant observer char *LCL_VERSION;@*/ >>src\Headers\herald.h
echo # define LCL_VERSION "LCLint $(LCL_VERSION) --- $(LCL_DATE)" >>src\Headers\herald.h
echo /*@constant observer char *LCL_PARSE_VERSION;@*/ >>src\Headers\herald.h
echo # define LCL_PARSE_VERSION "LCLint $(LCL_VERSION)" >>src\Headers\herald.h
echo /*@constant observer char *LCL_COMPILE;@*/ >>src\Headers\herald.h
echo $(COMPILE_MSG) >>src\Headers\herald.h
clean:
$(MAKE) --directory=src -f Makefile.os2 clean
rm bin\lclint.exe
###
### locations of standard LCLint files
###
### this should NOT have to be edited if you use the standard
### installation package
CP = cp
LCLINTBINDIR = $(BASEDIR)\bin
LCLINTBIN = lclint.exe
LCLINTLIB = $(BASEDIR)\lib
LCLINTIMPORTS = $(BASEDIR)\imports
LCLINTEMACS = $(BASEDIR)\emacs\lclint.el
LCLINTEMACSC = $(BASEDIR)\emacs\lclint.elc
###
### uses recursive make calls directly, so installation
### will continue even if there are errors!
###
install:
$(MAKE) dobinaries -f Makefile.os2
$(MAKE) dolibraries -f Makefile.os2
$(MAKE) doimports -f Makefile.os2
$(MAKE) doemacs -f Makefile.os2
doemacs:
$(CP) $(LCLINTEMACS) $(EMACSLIBDIR)
$(CP) $(LCLINTEMACSC) $(EMACSLIBDIR)
dobinaries:
$(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR)
dolibraries:
-mkdir$E $(LIBDIR)
$(CP) $(LCLINTLIB)\\* $(LIBDIR)
doimports:
-mkdir$E $(IMPORTSDIR)
$(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR)