blob: 7068d8f70e3dd715473a1358c21f897ab1ba8134 [file] [log] [blame]
K.Takata5bc13452022-09-09 10:52:47 +01001# 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
K.Takata12715722023-05-25 16:43:27 +010011APPVER = 6.01
K.Takata5bc13452022-09-09 10:52:47 +010012!endif
K.Takata12715722023-05-25 16:43:27 +010013# Set the default $(WINVER) to make it work with Windows 7.
K.Takata5bc13452022-09-09 10:52:47 +010014!ifndef WINVER
K.Takata12715722023-05-25 16:43:27 +010015WINVER = 0x0601
K.Takata5bc13452022-09-09 10:52:47 +010016!endif
17
18!if "$(DEBUG)" != "yes"
19NODEBUG = 1
20!endif
21
22!ifdef PROCESSOR_ARCHITECTURE
23# On Windows NT
24! ifndef CPU
25CPU = i386
26! if !defined(PLATFORM) && defined(TARGET_CPU)
27PLATFORM = $(TARGET_CPU)
28! endif
29! ifdef PLATFORM
30! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
31CPU = AMD64
32! elseif ("$(PLATFORM)" == "arm64") || ("$(PLATFORM)" == "ARM64")
33CPU = ARM64
34! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
35! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
36! endif
37! endif
38! endif
39!else
40CPU = i386
41!endif
42
43!ifdef SDK_INCLUDE_DIR
K.Takata12715722023-05-25 16:43:27 +010044! include $(SDK_INCLUDE_DIR)\Win32.mak
K.Takata5bc13452022-09-09 10:52:47 +010045!elseif "$(USE_WIN32MAK)"=="yes"
K.Takata12715722023-05-25 16:43:27 +010046! include <Win32.mak>
K.Takata5bc13452022-09-09 10:52:47 +010047!else
48cc = cl
49link = link
50rc = rc
51cflags = -nologo -c
52lflags = -incremental:no -nologo
53rcflags = /r
54olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
55!endif
56
57# include CPUARG
58cflags = $(cflags) $(CPUARG)
59
60# set WINVER and _WIN32_WINNT
61cflags = $(cflags) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
62
63!if "$(CL)" == "/D_USING_V110_SDK71_"
64rcflags = $(rcflags) /D_USING_V110_SDK71_
65!endif
66
67SUBSYSTEM = console
68!if "$(SUBSYSTEM_VER)" != ""
69SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
70!endif
71
72!if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
73OFFSET = 0x11C000000
74!else
75OFFSET = 0x1C000000
76!endif
77
78all: gvimext.dll
79
80gvimext.dll: gvimext.obj \
81 gvimext.res
82 $(link) $(lflags) -dll -def:gvimext.def -base:$(OFFSET) -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib -subsystem:$(SUBSYSTEM)
83 if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2
84
85gvimext.obj: gvimext.h
86
87.cpp.obj:
88 $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp
89
90gvimext.res: gvimext.rc
91 $(rc) /nologo $(rcflags) $(rcvars) gvimext.rc
92
93clean:
94 - if exist gvimext.dll del gvimext.dll
95 - if exist gvimext.lib del gvimext.lib
96 - if exist gvimext.exp del gvimext.exp
97 - if exist gvimext.obj del gvimext.obj
98 - if exist gvimext.res del gvimext.res
99 - if exist gvimext.dll.manifest del gvimext.dll.manifest