################################################## ### ### 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 VisualAge C++ 3.0 ### ### 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=3.0.0.16 LCL_DATE=25 Sep 2001 # this gets written into the binary, add your name, your compiler settings # etc. if you like. TODAY=Monday 25 Sep 19:40 MEST 2001 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 4\" ### 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)" ### directory for lclint binary INSTALLDIR = \\usr\\bin ### this should be the complete path for the directory where this ### Makefile is, with no trailing / or spaces. BASEDIR = e:\\usr\\src\\lclint-$(LCL_VERSION) ### ### Then, run: ### ### make ### ### I recommend doing this in an emacs shell (or buffered terminal) so ### you can scroll through the output. ### ### This should (hopefully) work on most systems without further changes. ### ### If you do not have gcc, set CC = cc (or some other compiler) ### later in this file. ### ### It should: ### o build lclint ### o put lclint in BASEDIR/bin/lclint ### ### If you have installed the test suite, then do: ### ### make test ### ### to verify lclint. ### ### ### If you wish to install lclint in some other directory, set these ### variables, and do ### ### make install ### ### installation command (I use emx GNUish utilities) CP = cp MV = mv CAT = type RM = rm INSTALL = cp INSTALLFLAGS = ECHO = "echo.exe" ### ### end of installation variables ### ### ### 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 -g CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 CFLAGS=-Wall 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=-Wall OFLAG=-o LINKFLAGS = lclint.def -lfl O=.obj E=.exe else ifeq ($(COMPILER), icc-os2) # Shame! Normally no warnings should be turned off, but IBM's are # so stupid they warn me about each llassert(). Let's check our # code using lclint then develop it on gcc and then move to IBMC... CC = icc -q -W2 -Dunlink=unlink -O+ -G5 -Gf+ -Gi+ -Gs+ #CSet 2.01 needs this: #-D__STDC__ CPPFLAGS=-I.\Headers -DSTDC_HEADERS=1 -DOS2 CFLAGS= OFLAG=-fe LINKFLAGS = -B/noe setargv.obj 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 = ### ### is the test suite available? (must be full path here) ### TESTDIR = $(BASEDIR)/test ### ### 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 test ### ### set this to a different directory ### to install binaries elsewhere ### RELEASEDIR = $(BASEDIR)/bin all: @$(ECHO) @$(ECHO) "Creating configuration file. Syntax error message can be ignored..." @$(ECHO) $(MAKE) -f Makefile.os2 --warn-undefined-variables configinc @$(ECHO) @$(ECHO) "Creating local constants header file. Syntax error messages can be ignored..." @$(ECHO) $(MAKE) ARGV=$(ARGV) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables localconstants @$(ECHO) @$(ECHO) "Now building lclint executable file..." @$(ECHO) $(MAKE) -f Makefile.os2 --directory=$(BASEDIR)\\src --warn-undefined-variables @$(ECHO) @$(ECHO) "Now moving lclint executable file to bin directory..." @$(ECHO) $(MV) $(BASEDIR)\src\lclint$E $(RELEASEDIR)\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 $(ECHO) "CP=$(CP)" >>config.inc $(ECHO) "ECHO=\"$(ECHO)\"" >>config.inc $(CP) $(BASEDIR)\src\Headers\herald.h $(BASEDIR)\src\Headers\herald.last $(ECHO) "/* herald.h - created automatically from herald.os2 and Makefile.os2 */" >$(BASEDIR)\src\Headers\herald.h $(ECHO) "/*@constant observer char *LCL_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h $(ECHO) "# define LCL_VERSION \"LCLint $(LCL_VERSION) --- $(LCL_DATE)\"" >>$(BASEDIR)\src\Headers\herald.h $(ECHO) "/*@constant observer char *LCL_PARSE_VERSION;@*/" >>$(BASEDIR)\src\Headers\herald.h $(ECHO) "# define LCL_PARSE_VERSION \"LCLint $(LCL_VERSION)\"" >>$(BASEDIR)\src\Headers\herald.h $(ECHO) "/*@constant observer char *LCL_COMPILE;@*/" >>$(BASEDIR)\src\Headers\herald.h $(ECHO) "$(COMPILE_MSG)" >>$(BASEDIR)\src\Headers\herald.h ### ### locations of standard LCLint files ### ### this should NOT have to be edited if you use the standard ### installation package LCLINTBINDIR = $(BASEDIR)/bin LCLINTLIB = $(BASEDIR)/lib LCLINTIMPORTS = $(BASEDIR)/imports ### ### 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 dobinaries: $(INSTALL) $(INSTALLFLAGS) $(LCLINTBINDIR)\lclint$E $(INSTALLDIR) dolibraries: -mkdir$E $(LIBDIR) $(CP) $(LCLINTLIB)\\* $(LIBDIR) doimports: -mkdir$E $(IMPORTSDIR) $(CP) $(LCLINTIMPORTS)\\* $(IMPORTSDIR)