1# Makefile for GvimExt, using MSVC 2# Options: 3# DEBUG=yes Build debug version (for VC7 and maybe later) 4# CPUARG= /arch:IA32/AVX/etc, call from main makefile to set 5# automatically from CPUNR 6# 7 8TARGETOS = WINNT 9 10!ifndef APPVER 11APPVER = 5.01 12!endif 13!ifndef WINVER 14WINVER = 0x0501 15!endif 16 17!if "$(DEBUG)" != "yes" 18NODEBUG = 1 19!endif 20 21!ifdef PROCESSOR_ARCHITECTURE 22# On Windows NT 23! ifndef CPU 24CPU = i386 25! if !defined(PLATFORM) && defined(TARGET_CPU) 26PLATFORM = $(TARGET_CPU) 27! endif 28! ifdef PLATFORM 29! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64") 30CPU = AMD64 31! elseif ("$(PLATFORM)" == "arm64") || ("$(PLATFORM)" == "ARM64") 32CPU = ARM64 33! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86") 34! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted. 35! endif 36! endif 37! endif 38!else 39CPU = i386 40!endif 41 42!ifdef SDK_INCLUDE_DIR 43!include $(SDK_INCLUDE_DIR)\Win32.mak 44!elseif "$(USE_WIN32MAK)"=="yes" 45!include <Win32.mak> 46!else 47cc = cl 48link = link 49rc = rc 50cflags = -nologo -c 51lflags = -incremental:no -nologo 52rcflags = /r 53olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib 54!endif 55 56# include CPUARG 57cflags = $(cflags) $(CPUARG) 58 59# set WINVER and _WIN32_WINNT 60cflags = $(cflags) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) 61 62!if "$(CL)" == "/D_USING_V110_SDK71_" 63rcflags = $(rcflags) /D_USING_V110_SDK71_ 64!endif 65 66SUBSYSTEM = console 67!if "$(SUBSYSTEM_VER)" != "" 68SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER) 69!endif 70 71!if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64" 72OFFSET = 0x11C000000 73!else 74OFFSET = 0x1C000000 75!endif 76 77all: gvimext.dll 78 79gvimext.dll: gvimext.obj \ 80 gvimext.res 81 $(link) $(lflags) -dll -def:gvimext.def -base:$(OFFSET) -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib -subsystem:$(SUBSYSTEM) 82 if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2 83 84gvimext.obj: gvimext.h 85 86.cpp.obj: 87 $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp 88 89gvimext.res: gvimext.rc 90 $(rc) /nologo $(rcflags) $(rcvars) gvimext.rc 91 92clean: 93 - if exist gvimext.dll del gvimext.dll 94 - if exist gvimext.lib del gvimext.lib 95 - if exist gvimext.exp del gvimext.exp 96 - if exist gvimext.obj del gvimext.obj 97 - if exist gvimext.res del gvimext.res 98 - if exist gvimext.dll.manifest del gvimext.dll.manifest 99