1 # -*- Makefile -*- for gettext-runtime/libasprintf
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 # PREFIX=Some\Directory Base directory for installation
14 # Note that nmake command line flags are automatically passed to subdirectory
15 # Makefiles. Therefore we don't need to pass them explicitly to subdirectory
16 # Makefiles, but the subdirectory Makefiles need to have the same defaults.
34 # Directories used by "make install":
36 exec_prefix = $(prefix)
37 datadir = $(prefix)\share
38 bindir = $(exec_prefix)\bin
39 libdir = $(exec_prefix)\lib
40 includedir = $(prefix)\include
41 # For this subpackage only.
42 sub_docdir = $(datadir)\doc\libasprintf
44 # Programs used by "make":
49 # Set to -W3 if you want to see maximum amount of warnings, including stupid
50 # ones. Set to -W1 to avoid warnings about signed/unsigned combinations.
56 # "-GD" (msvc5) optimizes for DLL.
57 # mscv4 doesn't know about this flag and ignores it.
65 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
66 OPTIMFLAGS = -D_NDEBUG -O1
70 # -DBUILDING_LIBASPRINTF: Change expansion of LIBASPRINTF_DLL_EXPORTED macro.
71 CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DBUILDING_LIBASPRINTF
72 CXXFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DBUILDING_LIBASPRINTF -GX
82 # Programs used by "make install":
84 INSTALL_PROGRAM = copy
87 #### End of system configuration section. ####
91 OBJECTS = lib-asprintf.obj autosprintf.obj
93 RESOURCES = asprintf.res
95 all : autosprintf.h asprintf.lib
99 $(LN) autosprintf.h.in autosprintf.h
101 $(LN) autosprintf.h.msvc-shared autosprintf.h
104 config.h : config.h.msvc
106 $(LN) config.h.msvc config.h
110 $(LN) alloca_.h alloca.h
112 lib-asprintf.obj : lib-asprintf.c config.h printf-args.h printf-args.c printf-parse.h printf-parse.c alloca.h vasnprintf.h vasnprintf.c asnprintf.c vasprintf.h vasprintf.c asprintf.c
113 $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c lib-asprintf.c
115 autosprintf.obj : autosprintf.cc autosprintf.h config.h lib-asprintf.h
116 $(CXX) $(INCLUDES) $(CXXFLAGS) $(PICFLAGS) -c autosprintf.cc
120 asprintf.lib : $(OBJECTS)
122 $(AR) $(AR_FLAGS)asprintf.lib $(OBJECTS)
126 # asprintf.dll and asprintf.lib are created together.
127 asprintf.lib : $(OBJECTS) $(RESOURCES)
128 $(CC) $(MFLAGS) $(DEBUGFLAGS) -LD $(OBJECTS) $(RESOURCES) -Feasprintf.dll
130 asprintf.res : windows/asprintf.rc
131 rc -Fo asprintf.res windows/asprintf.rc
138 $(INSTALL_DATA) autosprintf.h $(includedir)\autosprintf.h
139 -mkdir $(exec_prefix)
142 $(INSTALL_DATA) asprintf.dll $(bindir)\asprintf.dll
145 $(INSTALL_DATA) asprintf.lib $(libdir)\asprintf.lib
147 -mkdir $(datadir)\doc
149 $(INSTALL_DATA) autosprintf_all.html $(sub_docdir)\autosprintf.html
154 -mkdir $(exec_prefix)
160 -mkdir $(datadir)\doc
164 $(RM) $(includedir)\autosprintf.h
166 $(RM) $(bindir)\asprintf.dll
168 $(RM) $(libdir)\asprintf.lib
169 $(RM) $(sub_docdir)\autosprintf.html
188 maintainer-clean : distclean