-
Notifications
You must be signed in to change notification settings - Fork 89
/
Makefile.wnm
72 lines (56 loc) · 2.06 KB
/
Makefile.wnm
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
# Makefile for less.
# Windows 32/64 Visual C++ version
#
# To build in msvc env (VCVARS32.BAT, VCVARS64.BAT, ...)
#
# A release tarball:
# nmake -f Makefile.wnm
#
# A git snapshot:
# nmake -f Makefile.wnm generated
# nmake -f Makefile.wnm
#
# If cross compiling (e.g. arm): "generated" should be made in a native env.
# Else (native build) this works too: nmake -f Makefile.wnm generated less.exe
#### Start of system configuration section. ####
CC = cl
# Normal flags
CFLAGS = /nologo /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c
LDFLAGS = /nologo /subsystem:console /incremental:no
# Debugging flags
#CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c
#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug
LD = link
LIBS = user32.lib shell32.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) $<
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj evar.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj lesskey_parse.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 xbuf.obj regexp.obj
all: less.exe lesskey.exe
less.exe: $(OBJ)
$(LD) $(LDFLAGS) $** $(LIBS) /out:$@
lesskey.exe: lesskey.obj lesskey_parse.obj version.obj xbuf.obj
$(LD) $(LDFLAGS) lesskey.obj lesskey_parse.obj version.obj xbuf.obj $(LIBS) /out:$@
defines.h: defines.wn
-del defines.h
-copy defines.wn defines.h
$(OBJ): less.h defines.h funcs.h cmd.h
# generate help.c and funcs.h. We use *.c because we don't have a sources list.
# intentionally detached from $(OBJ) in case of cross compile - needs native cc
generated:
$(CC) buildgen.c
buildgen.exe help < less.hlp > help.c
type *.c 2>NUL | buildgen.exe funcs > funcs.h
clean:
-del *.obj
-del less.exe
-del lesskey.exe
-del defines.h