Skip to content

Commit

Permalink
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Browse files Browse the repository at this point in the history
Problem:    MS-Windows makefiles are inconsistently named.
Solution:   Use consistent names. (Ken Takata, closes #11088)
  • Loading branch information
k-takata authored and brammool committed Sep 9, 2022
1 parent c572ad5 commit 5bc1345
Show file tree
Hide file tree
Showing 13 changed files with 310 additions and 299 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Expand Up @@ -26,9 +26,9 @@ test_script:
- cd src/testdir
# Testing with MSVC gvim
- path C:\Python35-x64;%PATH%
- nmake -f Make_dos.mak VIMPROG=..\gvim
- nmake -f Make_dos.mak clean
- nmake -f Make_mvc.mak VIMPROG=..\gvim
- nmake -f Make_mvc.mak clean
# Testing with MSVC console version
- nmake -f Make_dos.mak VIMPROG=..\vim
- nmake -f Make_mvc.mak VIMPROG=..\vim

# vim: sw=2 sts=2 et ts=8 sr
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -563,11 +563,11 @@ jobs:
call "%VCVARSALL%" ${{ matrix.vcarch }}
echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
start cmd /c "cd src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
start cmd /c "cd src2\testdir & nmake -nologo -f Make_mvc.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
echo %COL_GREEN%Test gVim:%COL_RESET%
cd src\testdir
nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
nmake -nologo -f Make_mvc.mak VIMPROG=..\gvim || exit 1
- name: Show the result of testing Vim
shell: cmd
Expand All @@ -590,7 +590,7 @@ jobs:
echo %COL_GREEN%The result of testing Vim:%COL_RESET%
cd src2\testdir
if exist messages type messages
nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
nmake -nologo -f Make_mvc.mak report VIMPROG=..\..\src\vim || exit 1
if "%timeout%"=="1" (
echo %COL_RED%Timed out.%COL_RESET%
Expand Down
11 changes: 5 additions & 6 deletions Filelist
Expand Up @@ -171,7 +171,6 @@ SRC_ALL = \
src/viminfo.c \
src/winclip.c \
src/window.c \
src/tee/tee.c \
src/xxd/xxd.c \
src/testdir/gen_opt_test.vim \
src/testdir/README.txt \
Expand Down Expand Up @@ -487,7 +486,6 @@ SRC_UNIX = \
src/vimtutor \
src/gvimtutor \
src/which.sh \
src/tee/Makefile \
src/xxd/Makefile \

# source files for both DOS and Unix
Expand Down Expand Up @@ -516,7 +514,7 @@ SRC_DOS_UNIX = \
src/proto/if_tcl.pro \
src/typemap \

# source files for DOS (also in the extra archive)
# source files for MS-Windows (also in the extra archive)
SRC_DOS = \
src/GvimExt/*.mak \
src/GvimExt/GvimExt.reg \
Expand Down Expand Up @@ -570,6 +568,7 @@ SRC_DOS = \
src/proto/os_win32.pro \
src/proto/os_mswin.pro \
src/testdir/Make_dos.mak \
src/testdir/Make_mvc.mak \
src/testdir/Make_ming.mak \
src/testdir/dos.vim \
src/uninstall.c \
Expand All @@ -578,7 +577,10 @@ SRC_DOS = \
src/vimrun.c \
src/xpm_w32.c \
src/xpm_w32.h \
src/tee/Make_ming.mak \
src/tee/Make_mvc.mak \
src/tee/Makefile \
src/tee/tee.c \
src/xxd/Make_ming.mak \
src/xxd/Make_mvc.mak \
nsis/gvim.nsi \
Expand Down Expand Up @@ -945,9 +947,6 @@ EXTRA = \
README_extra.txt \
src/VisVim/VisVim.dll \
runtime/vimlogo.xpm \
src/tee/Makefile \
src/tee/Make_mvc.mak \
src/tee/tee.c \

# files in READMEdir that are included from the top dir
IN_README_DIR = \
Expand Down
98 changes: 98 additions & 0 deletions src/GvimExt/Make_mvc.mak
@@ -0,0 +1,98 @@
# Makefile for GvimExt, using MSVC
# Options:
# DEBUG=yes Build debug version (for VC7 and maybe later)
# CPUARG= /arch:IA32/AVX/etc, call from main makefile to set
# automatically from CPUNR
#

TARGETOS = WINNT

!ifndef APPVER
APPVER = 5.01
!endif
!ifndef WINVER
WINVER = 0x0501
!endif

!if "$(DEBUG)" != "yes"
NODEBUG = 1
!endif

!ifdef PROCESSOR_ARCHITECTURE
# On Windows NT
! ifndef CPU
CPU = i386
! if !defined(PLATFORM) && defined(TARGET_CPU)
PLATFORM = $(TARGET_CPU)
! endif
! ifdef PLATFORM
! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
CPU = AMD64
! elseif ("$(PLATFORM)" == "arm64") || ("$(PLATFORM)" == "ARM64")
CPU = ARM64
! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
! endif
! endif
! endif
!else
CPU = i386
!endif

!ifdef SDK_INCLUDE_DIR
!include $(SDK_INCLUDE_DIR)\Win32.mak
!elseif "$(USE_WIN32MAK)"=="yes"
!include <Win32.mak>
!else
cc = cl
link = link
rc = rc
cflags = -nologo -c
lflags = -incremental:no -nologo
rcflags = /r
olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
!endif

# include CPUARG
cflags = $(cflags) $(CPUARG)

# set WINVER and _WIN32_WINNT
cflags = $(cflags) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)

!if "$(CL)" == "/D_USING_V110_SDK71_"
rcflags = $(rcflags) /D_USING_V110_SDK71_
!endif

SUBSYSTEM = console
!if "$(SUBSYSTEM_VER)" != ""
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
!endif

!if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
OFFSET = 0x11C000000
!else
OFFSET = 0x1C000000
!endif

all: gvimext.dll

gvimext.dll: gvimext.obj \
gvimext.res
$(link) $(lflags) -dll -def:gvimext.def -base:$(OFFSET) -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib -subsystem:$(SUBSYSTEM)
if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2

gvimext.obj: gvimext.h

.cpp.obj:
$(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp

gvimext.res: gvimext.rc
$(rc) /nologo $(rcflags) $(rcvars) gvimext.rc

clean:
- if exist gvimext.dll del gvimext.dll
- if exist gvimext.lib del gvimext.lib
- if exist gvimext.exp del gvimext.exp
- if exist gvimext.obj del gvimext.obj
- if exist gvimext.res del gvimext.res
- if exist gvimext.dll.manifest del gvimext.dll.manifest
100 changes: 3 additions & 97 deletions src/GvimExt/Makefile
@@ -1,98 +1,4 @@
# Makefile for GvimExt, using MSVC
# Options:
# DEBUG=yes Build debug version (for VC7 and maybe later)
# CPUARG= /arch:IA32/AVX/etc, call from main makefile to set
# automatically from CPUNR
#
!message This makefile is deprecated. Use Make_mvc.mak instead.
!message

TARGETOS = WINNT

!ifndef APPVER
APPVER = 5.01
!endif
!ifndef WINVER
WINVER = 0x0501
!endif

!if "$(DEBUG)" != "yes"
NODEBUG = 1
!endif

!ifdef PROCESSOR_ARCHITECTURE
# On Windows NT
! ifndef CPU
CPU = i386
! if !defined(PLATFORM) && defined(TARGET_CPU)
PLATFORM = $(TARGET_CPU)
! endif
! ifdef PLATFORM
! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
CPU = AMD64
! elseif ("$(PLATFORM)" == "arm64") || ("$(PLATFORM)" == "ARM64")
CPU = ARM64
! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
! endif
! endif
! endif
!else
CPU = i386
!endif

!ifdef SDK_INCLUDE_DIR
!include $(SDK_INCLUDE_DIR)\Win32.mak
!elseif "$(USE_WIN32MAK)"=="yes"
!include <Win32.mak>
!else
cc = cl
link = link
rc = rc
cflags = -nologo -c
lflags = -incremental:no -nologo
rcflags = /r
olelibsdll = ole32.lib uuid.lib oleaut32.lib user32.lib gdi32.lib advapi32.lib
!endif

# include CPUARG
cflags = $(cflags) $(CPUARG)

# set WINVER and _WIN32_WINNT
cflags = $(cflags) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)

!if "$(CL)" == "/D_USING_V110_SDK71_"
rcflags = $(rcflags) /D_USING_V110_SDK71_
!endif

SUBSYSTEM = console
!if "$(SUBSYSTEM_VER)" != ""
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
!endif

!if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
OFFSET = 0x11C000000
!else
OFFSET = 0x1C000000
!endif

all: gvimext.dll

gvimext.dll: gvimext.obj \
gvimext.res
$(link) $(lflags) -dll -def:gvimext.def -base:$(OFFSET) -out:$*.dll $** $(olelibsdll) shell32.lib comctl32.lib -subsystem:$(SUBSYSTEM)
if exist $*.dll.manifest mt -nologo -manifest $*.dll.manifest -outputresource:$*.dll;2

gvimext.obj: gvimext.h

.cpp.obj:
$(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp

gvimext.res: gvimext.rc
$(rc) /nologo $(rcflags) $(rcvars) gvimext.rc

clean:
- if exist gvimext.dll del gvimext.dll
- if exist gvimext.lib del gvimext.lib
- if exist gvimext.exp del gvimext.exp
- if exist gvimext.obj del gvimext.obj
- if exist gvimext.res del gvimext.res
- if exist gvimext.dll.manifest del gvimext.dll.manifest
!include Make_mvc.mak
4 changes: 2 additions & 2 deletions src/Make_cyg_ming.mak
Expand Up @@ -1149,7 +1149,7 @@ xxd/xxd.exe: xxd/xxd.c
$(MAKE) -C xxd -f Make_ming.mak CC='$(CC)'

tee/tee.exe: tee/tee.c
$(MAKE) -C tee CC='$(CC)'
$(MAKE) -C tee -f Make_ming.mak CC='$(CC)'

GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
Expand All @@ -1176,7 +1176,7 @@ ifdef MZSCHEME
endif
$(MAKE) -C GvimExt -f Make_ming.mak clean
$(MAKE) -C xxd -f Make_ming.mak clean
$(MAKE) -C tee clean
$(MAKE) -C tee -f Make_ming.mak clean

# Run vim script to generate the Ex command lookup table.
# This only needs to be run when a command name has been added or changed.
Expand Down
30 changes: 15 additions & 15 deletions src/Make_mvc.mak
Expand Up @@ -1400,7 +1400,7 @@ tee/tee.exe: tee/tee.c

GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
cd GvimExt
$(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
$(MAKE) /NOLOGO -f Make_mvc.mak $(MAKEFLAGS_GVIMEXT)
cd ..


Expand Down Expand Up @@ -1441,7 +1441,7 @@ clean: testclean
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..
cd GvimExt
$(MAKE) /NOLOGO -f Makefile clean
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..

# Run vim script to generate the Ex command lookup table.
Expand All @@ -1463,36 +1463,36 @@ nvcmdidxs: nv_cmds.h

test:
cd testdir
$(MAKE) /NOLOGO -f Make_dos.mak
$(MAKE) /NOLOGO -f Make_mvc.mak
cd ..

testgvim testgui:
cd testdir
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\gvim
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\gvim
cd ..

testtiny:
cd testdir
$(MAKE) /NOLOGO -f Make_dos.mak tiny
$(MAKE) /NOLOGO -f Make_mvc.mak tiny
cd ..

testgvimtiny:
cd testdir
$(MAKE) /NOLOGO -f Make_dos.mak tiny VIMPROG=..\gvim
$(MAKE) /NOLOGO -f Make_mvc.mak tiny VIMPROG=..\gvim
cd ..

testclean:
cd testdir
$(MAKE) /NOLOGO -f Make_dos.mak clean
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..

# Run individual OLD style test.
# These do not depend on the executable, compile it when needed.
$(SCRIPTS_TINY):
cd testdir
- if exist $@.out del $@.out
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $@.out
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) $@.out
@ if exist test.log ( type test.log & exit /b 1 )
cd ..

Expand All @@ -1501,19 +1501,19 @@ $(SCRIPTS_TINY):
$(NEW_TESTS):
cd testdir
- if exist $@.res del $@.res
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $@.res
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) report
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) $@.res
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) report
cd ..

# Run Vim9 tests.
# These do not depend on the executable, compile it when needed.
test_vim9:
cd testdir
-del test_vim9_*.res
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $(TEST_VIM9_RES)
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) report
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) $(TEST_VIM9_RES)
$(MAKE) /NOLOGO -f Make_mvc.mak VIMPROG=..\$(VIMTESTTARGET) report
cd ..

###########################################################################
Expand Down

0 comments on commit 5bc1345

Please sign in to comment.