1# -*- Makefile -*- for srclib
2
3#### Start of system configuration section. ####
4
5# Flags that can be set on the nmake command line:
6#   DLL=1     for compiling a .dll with a stub .lib (default is a static .lib)
7#             Note that this works only with MFLAGS=-MD.
8#   MFLAGS={-ML|-MT|-MD} for defining the compilation model
9#     MFLAGS=-ML (the default)  Single-threaded, statically linked - libc.lib
10#     MFLAGS=-MT                Multi-threaded, statically linked  - libcmt.lib
11#     MFLAGS=-MD                Multi-threaded, dynamically linked - msvcrt.lib
12#   DEBUG=1   for compiling with debugging information
13#   NO_NLS=1  do not use Native Language Support
14#   PREFIX=Some\Directory   Base directory for installation
15!if !defined(DLL)
16DLL=0
17!endif
18!if !defined(DEBUG)
19DEBUG=0
20!endif
21!if !defined(MFLAGS)
22!if !$(DLL)
23MFLAGS=
24!else
25MFLAGS=-MD
26!endif
27!endif
28!if !defined(NO_NLS)
29NO_NLS=0
30!endif
31!if !defined(PREFIX)
32PREFIX = c:\usr
33!endif
34
35# Directories used by "make install":
36prefix = $(PREFIX)
37exec_prefix = $(prefix)
38bindir = $(exec_prefix)\bin
39libdir = $(exec_prefix)\lib
40includedir = $(prefix)\include
41
42# Programs used by "make":
43
44CC = cl
45
46# Set to -W3 if you want to see maximum amount of warnings, including stupid
47# ones. Set to -W1 to avoid warnings about signed/unsigned combinations.
48WARN_CFLAGS = -W1
49
50!if $(DEBUG)
51OPTIMFLAGS = -Od -Z7
52!else
53# Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
54OPTIMFLAGS = -D_NDEBUG -O1
55!endif
56
57!if $(NO_NLS)
58NLSFLAGS =
59INCINTL =
60LIBINTL =
61!else
62NLSFLAGS = -DENABLE_NLS=1
63INCINTL = -I$(includedir)
64LIBINTL = $(libdir)\intl.lib
65!endif
66
67CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H $(NLSFLAGS) -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1
68
69INCLUDES = -I. -I.. -I..\windows $(INCINTL)
70
71AR = lib
72AR_FLAGS = /out:
73
74LN = copy
75RM = -del
76
77# Programs used by "make install":
78INSTALL = copy
79INSTALL_PROGRAM = copy
80INSTALL_DATA = copy
81
82#### End of system configuration section. ####
83
84SHELL = /bin/sh
85
86OBJECTS = \
87  allocsa.obj \
88  error.obj \
89  progname.obj progreloc.obj \
90  xmalloc.obj xstrdup.obj \
91  \
92  relocatable.obj \
93  setenv.obj unsetenv.obj
94
95all : icrt.lib
96
97allocsa.obj : allocsa.c
98	$(CC) $(INCLUDES) $(CFLAGS) -c allocsa.c
99
100error.obj : error.c
101	$(CC) $(INCLUDES) $(CFLAGS) -c error.c
102
103progname.obj : progname.c
104	$(CC) $(INCLUDES) $(CFLAGS) -c progname.c
105
106progreloc.obj : progreloc.c
107	$(CC) $(INCLUDES) $(CFLAGS) -c progreloc.c
108
109xmalloc.obj : xmalloc.c
110	$(CC) $(INCLUDES) $(CFLAGS) -c xmalloc.c
111
112xstrdup.obj : xstrdup.c
113	$(CC) $(INCLUDES) $(CFLAGS) -c xstrdup.c
114
115relocatable.obj : relocatable.c
116	$(CC) $(INCLUDES) $(CFLAGS) -c relocatable.c
117
118setenv.obj : setenv.c
119	$(CC) $(INCLUDES) $(CFLAGS) -c setenv.c
120
121unsetenv.obj : unsetenv.c
122	$(CC) $(INCLUDES) $(CFLAGS) -c unsetenv.c
123
124icrt.lib : $(OBJECTS)
125	-$(RM) icrt.lib
126	$(AR) $(AR_FLAGS)icrt.lib $(OBJECTS)
127
128install : all force
129
130installdirs : force
131
132uninstall : force
133
134check : all
135
136mostlyclean : clean
137
138clean : force
139	$(RM) *.obj
140	$(RM) *.lib
141
142distclean : clean
143
144maintainer-clean : distclean
145
146force :
147