moved common stuff to CVSROOT/cvsignore
[libiconv.git] / lib / Makefile.msvc
blob682d863fc2366cd8ce1a93c4f831924649c1cee5
1 # Makefile for libiconv/lib
3 #### Start of system configuration section. ####
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 !if !defined(DLL)
14 DLL=0
15 !endif
16 !if !defined(DEBUG)
17 DEBUG=0
18 !endif
19 !if !defined(MFLAGS)
20 !if !$(DLL)
21 MFLAGS=
22 !else
23 MFLAGS=-MD
24 !endif
25 !endif
27 # Directories used by "make":
28 srcdir = .
30 # Directories used by "make install":
31 prefix = /usr/local
32 local_prefix = /usr/local
33 exec_prefix = $(prefix)
34 libdir = $(exec_prefix)/lib
36 # Programs used by "make":
38 CC = cl
40 # Set to -W3 if you want to see maximum amount of warnings, including stupid
41 # ones. Set to -W1 to avoid warnings about signed/unsigned combinations.
42 WARN_CFLAGS = -W1
44 !if !$(DLL)
45 PICFLAGS =
46 !else
47 # "-GD" (msvc5) optimizes for DLL.
48 # mscv4 doesn't know about this flag and ignores it.
49 PICFLAGS = -GD
50 !endif
52 !if $(DEBUG)
53 OPTIMFLAGS = -Od -Z7
54 !else
55 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
56 OPTIMFLAGS = -D_NDEBUG -O1
57 !endif
59 # -DBUILDING_LIBICONV: Change expansion of LIBICONV_DLL_EXPORTED macro.
60 CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(PICFLAGS) $(OPTIMFLAGS) -DBUILDING_LIBICONV
62 INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
64 AR = lib
65 AR_FLAGS = /out:
67 LN = copy
68 RM = del
70 # Programs used by "make install":
71 INSTALL = @INSTALL@
72 INSTALL_PROGRAM = @INSTALL_PROGRAM@
73 INSTALL_DATA = @INSTALL_DATA@
75 #### End of system configuration section. ####
77 SHELL = /bin/sh
79 SOURCES = $(srcdir)/iconv.c
81 OBJECTS = iconv.obj
83 LIBCHARSET_OBJECTS = ..\libcharset\lib\localcharset.obj
85 # Set to iconv.res in order to include the resources information.
86 RESOURCES =
87 # RESOURCES = iconv.res
89 all : iconv.lib
91 config.h : config.h.msvc
92         -$(RM) config.h
93         $(LN) config.h.msvc config.h
95 iconv.obj : $(srcdir)/iconv.c $(srcdir)/encodings.def $(srcdir)/encodings_local.def $(srcdir)/aliases.h config.h
96         $(CC) $(INCLUDES) $(CFLAGS) -c $(srcdir)/iconv.c
98 !if !$(DLL)
100 iconv.lib : $(OBJECTS)
101         -$(RM) iconv.lib
102         $(AR) $(AR_FLAGS)iconv.lib $(OBJECTS) $(LIBCHARSET_OBJECTS)
104 !else
106 # iconv.dll and iconv.lib are created together.
107 iconv.lib : $(OBJECTS) $(RESOURCES)
108         $(CC) $(MFLAGS) -LD $(OBJECTS) $(LIBCHARSET_OBJECTS) $(RESOURCES)
110 iconv.res : $(srcdir)/../windows/iconv.rc
111         rc -Fo iconv.res $(srcdir)/../windows/iconv.rc
113 !endif
115 check : all
117 mostlyclean : clean
119 clean : force
120         $(RM) *.obj
121         $(RM) *.lib
122         $(RM) *.exp
123         $(RM) *.dll
124         $(RM) iconv.res
125         $(RM) core
127 distclean : clean
128         $(RM) config.h
130 maintainer-clean : distclean
132 force :