summaryrefslogtreecommitdiff
path: root/Makefile.msvc
blob: c227b85979934eef3f4ef6e51360900840db0955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# -*- Makefile -*- for gperf

# Copyright (C) 2003 Free Software Foundation, Inc.
# Written by Bruno Haible <bruno@clisp.org>.
#
# This file is part of GNU GPERF.
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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.  If not, see <http://www.gnu.org/licenses/>.

#### 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)
datadir = $(prefix)\share
bindir = $(exec_prefix)\bin
mandir = $(datadir)\man
man1dir = $(mandir)\man1
docdir = $(datadir)\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
DEBUGFLAGS = -Z7
!else
# Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
OPTIMFLAGS = -D_NDEBUG -O1
DEBUGFLAGS =
!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) $(MFLAGS) $(DEBUGFLAGS) $(OBJECTS) -Fegperf.exe

install : all force
	-mkdir $(prefix)
	-mkdir $(exec_prefix)
	-mkdir $(bindir)
	$(INSTALL_PROGRAM) gperf.exe $(bindir)\gperf.exe
	-mkdir $(datadir)
	-mkdir $(mandir)
	-mkdir $(man1dir)
	$(INSTALL_DATA) doc\gperf.1 $(man1dir)\gperf.1
	-mkdir $(datadir)\doc
	-mkdir $(docdir)
	$(INSTALL_DATA) doc\gperf.html $(docdir)\gperf.html

installdirs : force
	-mkdir $(prefix)
	-mkdir $(exec_prefix)
	-mkdir $(bindir)
	-mkdir $(datadir)
	-mkdir $(mandir)
	-mkdir $(man1dir)
	-mkdir $(datadir)\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 :