-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.win.msvc.nmake
109 lines (88 loc) · 3.94 KB
/
Makefile.win.msvc.nmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Makefile for less.
# Windows version; MS Visual C++
# nmake version
# `nmake /f Makefile.win.msvc.nmake`
# spell-checker:ignore (targets) distclean realclean vclean veryclean
# spell-checker:ignore (make) abspath firstword ifeq ifndef ifneq lastword undefine vclean veryclean
#
# spell-checker:ignore (acronyms/names) Borland Borland's LLVM MSVC MinGW POSIX VCvars
# spell-checker:ignore (flags/options) DDEBUG DNDEBUG NDEBUG Werror Wextra Xclang defaultlib dumpmachine flto flto-visibility-public-std libcmt nologo nothrow
# spell-checker:ignore (jargon) multilib
# spell-checker:ignore (shell/win) COMSPEC SystemDrive SystemRoot findstr findstring windir
# spell-checker:ignore (utils) ilink nmake
# spell-checker:ignore (vars) BQUOTE CFLAGS CPPFLAGS CXXFLAGS DEFINETYPE DQUOTE EXEEXT LDFLAGS LIBDIR LIBPATH MAKEDIR OBJDEP SHELLSTATUS devnull mkfile
# spell-checker:ignore () brac cmdbuf forwback funcs ifile lessecho lesskey linenum lsystem optfunc opttbl stdext ttyin
#### Start of system configuration section. ####
CC = cl
!IF ([ \
@"$(CC)" 2>&1 | "%SystemRoot%\System32\findstr" /i /c:"compiler version 12." \
] == 0)
is_VC6 = 1
!ENDIF
## ref: [MSVC Compiler Options] https://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx @@ https://archive.is/aOAtH
## /c :: compile only
CFLAGS_COMPILE_ONLY = /c
# VC6-specific flags
!IF "$(is_VC6)" != ""
## /ignore:4254 :: suppress "merging sections with different attributes" warning (LNK4254)
LDFLAGS_VC6 = /ignore:4254
!ENDIF
# Normal/usual flags
## /nologo :: startup without logo display
## /W3 :: set warning level to 3 [1..4, all; increasing level of warning scrutiny]
## /wd4996 :: suppress POSIX function name deprecation warning #C4996
## /WX :: treat warnings as errors
## /MT :: static linking
## /EHsc :: enable C++ EH (no SEH exceptions) + extern "C" defaults to nothrow (replaces deprecated /GX)
## /Ox :: maximum optimizations
## /O2 :: maximize speed
## /D "WIN32" :: old/extraneous define
## /D "_CONSOLE" :: old/extraneous define
## /D "NDEBUG" :: deactivate assert()
## /D "_CRT_SECURE_NO_WARNING" :: compiler directive == suppress "unsafe function" compiler warning
## /c :: compile only
CFLAGS = /nologo /W3 /WX /MT /EHsc /Ox /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS"
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 $(LDFLAGS_VC6)
# DEBUG flags
## /MTd :: static linking to debug library
## /Od :: disable optimization
## /Gm :: enables minimal rebuild
## /Zi :: generates complete debugging information
#CFLAGS = /nologo /W3 /MTd /EHsc /Od /Gm /Zi /I "." /D "WIN32" /D "DEBUG" /D "_CONSOLE" /c
#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386 $(LDFLAGS_VC6)
LD = link
LIBS = user32.lib
#### End of system configuration section. ####
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.obj:
$(CC) $(CFLAGS_COMPILE_ONLY) $(CPPFLAGS) $(CFLAGS) $<
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
tags.obj ttyin.obj version.obj regexp.obj
all: less.exe lesskey.exe
# This is really horrible, but the command line is too long for
# MS-DOS if we try to link ${OBJ}.
less.exe: $(OBJ)
-if EXIST "lesskey.obj" del lesskey.obj
$(LD) $(LDFLAGS) *.obj $(LIBS) /out:$@
lesskey.exe: lesskey.obj version.obj
$(LD) $(LDFLAGS) lesskey.obj version.obj $(LIBS) /out:$@
defines.h: defines.wn
-if EXIST "defines.h" del defines.h
-copy defines.wn defines.h
$(OBJ): less.h defines.h funcs.h cmd.h
clean:
-if EXIST "*.obj" del *.obj
-if EXIST "defines.h" del defines.h
-if EXIST "less.exe" del less.exe
-if EXIST "lesskey.exe" del lesskey.exe
build: all
compile: $(OBJ)
realclean: clean
rebuild: clean build
veryclean: realclean