diff options
author | Bruno Haible <bruno@clisp.org> | 2003-04-29 09:58:59 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2003-04-29 09:58:59 +0000 |
commit | 5fbcad1840cbf05be190e073c3c8e97af7b97f53 (patch) | |
tree | 8cef202f7f00df2cd44afd928062d8e28208c3fb | |
parent | 16e10a330c0bab99e776d6b86f2fc144cca7dc80 (diff) | |
download | gperf-5fbcad1840cbf05be190e073c3c8e97af7b97f53.tar.gz |
Support for building on Windows.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Makefile.devel | 5 | ||||
-rw-r--r-- | Makefile.msvc | 195 | ||||
-rw-r--r-- | README.woe32 | 26 |
4 files changed, 232 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2003-02-26 Bruno Haible <bruno@clisp.org> + + * Makefile.msvc: New file. + * README.woe32: New file. + * Makefile.devel (all): Depend on src/config.h.msvc. + (src/config.h.msvc): New rule. + 2003-01-07 Bruno Haible <bruno@clisp.org> * src/input.h (Input::_charset_dependent): New field. diff --git a/Makefile.devel b/Makefile.devel index 7e920ee..d958ab1 100644 --- a/Makefile.devel +++ b/Makefile.devel @@ -4,7 +4,7 @@ SHELL = /bin/sh MAKE = make -all : configures src/config.h.in doc/gperf.1 +all : configures src/config.h.in src/config.h.msvc doc/gperf.1 CONFIGURES = configure lib/configure src/configure tests/configure doc/configure @@ -31,6 +31,9 @@ check-configures : $(CONFIGURES) src/config.h.in : src/configure.in aclocal.m4 cd src && autoheader -l .. +src/config.h.msvc : src/config.h.in + cp src/config.h.in src/config.h.msvc + doc/gperf.1 : force prog=`PATH=build/src:src:$$PATH which gperf`; if test -n "$$prog"; then doc/help2man --name='generate a perfect hash function from a key set' --section=1 $$prog > doc/gperf.1; fi diff --git a/Makefile.msvc b/Makefile.msvc new file mode 100644 index 0000000..b9343fa --- /dev/null +++ b/Makefile.msvc @@ -0,0 +1,195 @@ +# -*- Makefile -*- for gperf + +# Copyright (C) 2003 Free Software Foundation, Inc. +# Written by Bruno Haible <bruno@clisp.org>. +# +# This file is part of GNU GPERF. +# +# GNU GPERF is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU GPERF is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. +# If not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#### Start of system configuration section. #### + +# Flags that can be set on the nmake command line: +# MFLAGS={-ML|-MT|-MD} for defining the compilation model +# MFLAGS=-ML (the default) Single-threaded, statically linked - libc.lib +# MFLAGS=-MT Multi-threaded, statically linked - libcmt.lib +# MFLAGS=-MD Multi-threaded, dynamically linked - msvcrt.lib +# DEBUG=1 for compiling with debugging information +!if !defined(DEBUG) +DEBUG=0 +!endif +!if !defined(MFLAGS) +MFLAGS= +!endif + +# Directories used by "make": +srcdir = . + +# Directories used by "make install": +prefix = c:\usr +exec_prefix = $(prefix) +bindir = $(exec_prefix)\bin +mandir = $(prefix)\man +man1dir = $(mandir)\man1 +docdir = $(prefix)\doc\gperf + +# Programs used by "make": + +CC = cl +CXX = cl -TP + +# Set to -W3 if you want to see maximum amount of warnings, including stupid +# ones. Set to -W1 to avoid warnings about signed/unsigned combinations. +WARN_CFLAGS = -W1 + +!if $(DEBUG) +OPTIMFLAGS = -Od -Z7 +!else +# Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5. +OPTIMFLAGS = -D_NDEBUG -O1 +!endif + +CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) +CXXFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) + +INCLUDES = -Ilib -Isrc + +LN = copy +RM = -del + +# Programs used by "make install": +INSTALL = copy +INSTALL_PROGRAM = copy +INSTALL_DATA = copy + +#### End of system configuration section. #### + +SHELL = /bin/sh + +LIB_OBJECTS = lib\getopt.obj lib\getopt1.obj lib\getline.obj lib\hash.obj +SRC_OBJECTS = src\version.obj src\positions.obj src\options.obj src\keyword.obj src\keyword-list.obj src\input.obj src\bool-array.obj src\hash-table.obj src\search.obj src\output.obj src\main.obj +OBJECTS = $(LIB_OBJECTS) $(SRC_OBJECTS) + +all : gperf.exe + +src\config.h : src\config.h.msvc + -$(RM) src\config.h + $(LN) src\config.h.msvc src\config.h + +lib\getopt.obj : lib\getopt.c + $(CC) $(INCLUDES) $(CFLAGS) -c lib\getopt.c -Folib\getopt.obj + +lib\getopt1.obj : lib\getopt1.c + $(CC) $(INCLUDES) $(CFLAGS) -c lib\getopt1.c -Folib\getopt1.obj + +lib\getline.obj : lib\getline.cc + $(CXX) $(INCLUDES) $(CXXFLAGS) -c lib\getline.cc -Folib\getline.obj + +lib\hash.obj : lib\hash.cc + $(CXX) $(INCLUDES) $(CXXFLAGS) -c lib\hash.cc -Folib\hash.obj + +# Dependencies. +CONFIG_H = src\config.h +VERSION_H = src\version.h +POSITIONS_H = src\positions.h src\positions.icc +OPTIONS_H = src\options.h src\options.icc $(POSITIONS_H) +KEYWORD_H = src\keyword.h src\keyword.icc +KEYWORD_LIST_H = src\keyword-list.h src\keyword-list.icc $(KEYWORD_H) +INPUT_H = src\input.h $(KEYWORD_LIST_H) +BOOL_ARRAY_H = src\bool-array.h src\bool-array.icc $(OPTIONS_H) +HASH_TABLE_H = src\hash-table.h $(KEYWORD_H) +SEARCH_H = src\search.h $(KEYWORD_LIST_H) $(POSITIONS_H) $(BOOL_ARRAY_H) +OUTPUT_H = src\output.h $(KEYWORD_LIST_H) $(POSITIONS_H) + +src\version.obj : src\version.cc $(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\version.cc -Fosrc\version.obj + +src\positions.obj : src\positions.cc $(POSITIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\positions.cc -Fosrc\positions.obj + +src\options.obj : src\options.cc $(OPTIONS_H) $(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\options.cc -Fosrc\options.obj + +src\keyword.obj : src\keyword.cc $(KEYWORD_H) $(POSITIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\keyword.cc -Fosrc\keyword.obj + +src\keyword-list.obj : src\keyword-list.cc $(KEYWORD_LIST_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\keyword-list.cc -Fosrc\keyword-list.obj + +src\input.obj : src\input.cc $(INPUT_H) $(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\input.cc -Fosrc\input.obj + +src\bool-array.obj : src\bool-array.cc $(BOOL_ARRAY_H) $(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\bool-array.cc -Fosrc\bool-array.obj + +src\hash-table.obj : src\hash-table.cc $(HASH_TABLE_H) $(OPTIONS_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\hash-table.cc -Fosrc\hash-table.obj + +src\search.obj : src\search.cc $(SEARCH_H) $(OPTIONS_H) $(HASH_TABLE_H) $(CONFIG_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\search.cc -Fosrc\search.obj + +src\output.obj : src\output.cc $(OUTPUT_H) $(OPTIONS_H) $(VERSION_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\output.cc -Fosrc\output.obj + +src\main.obj : src\main.cc $(OPTIONS_H) $(INPUT_H) $(SEARCH_H) $(OUTPUT_H) + $(CXX) $(INCLUDES) $(CXXFLAGS) -c src\main.cc -Fosrc\main.obj + +gperf.exe : $(OBJECTS) + $(CC) $(OBJECTS) -Fegperf.exe + +install : all force + -mkdir $(prefix) + -mkdir $(exec_prefix) + -mkdir $(bindir) + $(INSTALL_PROGRAM) gperf.exe $(bindir)\gperf.exe + -mkdir $(mandir) + -mkdir $(man1dir) + $(INSTALL_DATA) doc\gperf.1 $(man1dir)\gperf.1 + -mkdir $(prefix)\doc + -mkdir $(docdir) + $(INSTALL_DATA) doc\gperf.html $(docdir)\gperf.html + +installdirs : force + -mkdir $(prefix) + -mkdir $(exec_prefix) + -mkdir $(bindir) + -mkdir $(mandir) + -mkdir $(man1dir) + -mkdir $(prefix)\doc + -mkdir $(docdir) + +uninstall : force + $(RM) $(bindir)\gperf.exe + $(RM) $(man1dir)\gperf.1 + $(RM) $(docdir)\gperf.html + +check : all + +mostlyclean : clean + +clean : force + $(RM) lib\*.obj + $(RM) src\*.obj + $(RM) gperf.exe + $(RM) core + +distclean : clean + $(RM) src\config.h + +maintainer-clean : distclean + +force : + diff --git a/README.woe32 b/README.woe32 new file mode 100644 index 0000000..7e20930 --- /dev/null +++ b/README.woe32 @@ -0,0 +1,26 @@ +Installation on Woe32 (WinNT/2000/XP, Win95/98/ME): + +- Requires MS Visual C/C++ 4.0 or 5.0 or 6.0 or 7.0. + +- Cannot build in a separate directory. + +- Build instructions: + + Make sure that the MSVC4.0 or MSVC5.0 or MSVC6.0 or MSVC7.0 utilities + ("cl" etc.) are found in PATH. In a typical MSVC6.0 installation, this + can be achieved by running + C:\Program Files\Microsoft Visual Studio\VC98\bin\vcvars32.bat + In a typical MSVC7.0 installation, it can be achieved by running + C:\Program Files\Microsoft Visual Studio .NET\VC7\bin\vcvars32.bat + + nmake -f Makefile.msvc + +- Installation: + + Either: + + Copy gperf.exe to your program repository. + + Or: + + nmake -f Makefile.msvc install prefix=InstallBaseDirectory |