## Makefile for building the iconv dlls with Microsoft C ## Use: nmake -f makefile.msc ## ## Used a writeup on the web to guide me: ## ## http://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio ## ICONV_VER=1.3 ################################################################ # Flags # See if debug is defined !IFNDEF DEBUG # Full optimization: OPTIMIZE = -O2 -MD !ELSE # Debugging: OPTIMIZE = -Z7 -MDd LINKDEBUG = /debug !ENDIF # The CC flags depend if NMCXXFLAGS was passed in. If so, it overrides everything. # cl -? describes the options #CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo !if "$(NMCXXFLAGS)" == "" CC = cl -GR $(OPTIMIZE) -W3 -nologo !else CC = cl -nologo $(NMCXXFLAGS) !endif LDFLAGS = /link $(LINKDEBUG) # Check if nmake version is 8.xx or 9.xx !if ([nmake /? 2>&1 | findstr /c:"Version 8\." > nul ] == 0) || \ ([nmake /? 2>&1 | findstr /c:"Version 9\." > nul ] == 0) MT_DLL = mt -nologo -manifest $@.manifest -outputresource:$@;2 CLEAN_MT = -@erase /q $@.manifest >nul 2>&1 !else MT_DLL = CLEAN_MT = !endif # # Basic C++ flags # CFLAGS = -I. -DBUILDING_LIBICONV -DBUILDING_LIBCHARSET #-DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" ###################### all : \ iconv-$(ICONV_VER).dll iconv_OBJECTS = \ relocatable.obj \ localcharset.obj \ iconv.obj \ ################ glib iconv-$(ICONV_VER).dll : $(iconv_OBJECTS) $(CC) $(CFLAGS) -LD -Feiconv-$(ICONV_VER).dll $(iconv_OBJECTS) $(LIBICONV_LIBS) $(INTL_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) $(MT_DLL) $(CLEAN_MT) .c.obj : $(CC) $(CFLAGS) -c $< ################ other stuff clean:: -@erase /q *.dll >nul 2>&1 -@erase /q *.obj >nul 2>&1 -@erase /q *.lib >nul 2>&1 -@erase /q *.err >nul 2>&1 -@erase /q *.res >nul 2>&1 -@erase /q *.exp >nul 2>&1 -@erase /q *.pdb >nul 2>&1 -@erase /q *.ilk >nul 2>&1