forked from Bill-Gray/PDCursesMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.vc
137 lines (105 loc) · 2.82 KB
/
Makefile.vc
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Visual C++ & Intel(R) NMakefile for PDCurses library - Windows VT-like VC++ 2.0+
#
# Usage: nmake -f [path\]Makefile.vc [DEBUG=] [DLL=] [WIDE=] [UTF8=]
# [ICC=] [CHTYPE_32=] [IX86=] [target]
#
# where target can be any of:
# [all|demos|pdcurses.lib|testcurs.exe...]
# CHTYPE_## is used to override the default 64-bit chtypes in favor
# of "traditional" 32- or 16-bit chtypes. (Untested for VT)
# IX86 is used to build 32-bit code instead of 64-bit
# ICC is used to invoke Intel (R) tools icl.exe and xilink.exe, instead of
# MS tools cl.exe and link.exe
O = obj
E = .exe
RM = del
!ifndef PDCURSES_SRCDIR
PDCURSES_SRCDIR = ..
!endif
!ifdef IX86
PLATFORM=IX86
!else
PLATFORM=X64
!endif
osdir = $(PDCURSES_SRCDIR)\vt
common = $(PDCURSES_SRCDIR)\common
!include $(common)\libobjs.mif
PDCURSES_WIN_H = $(osdir)\pdcvt.h
!ifdef DEBUG
CFLAGS = -Z7 -DPDCDEBUG
LDFLAGS = -debug -pdb:none
!else
CFLAGS = -O1
LDFLAGS =
!endif
CFLAGS = $(CFLAGS) -W4 -D_CRT_SECURE_NO_WARNINGS
!ifdef WIDE
WIDEOPT = -DPDC_WIDE
!endif
!ifdef UTF8
UTF8OPT = -DPDC_FORCE_UTF8
!endif
!ifdef CHTYPE_32
CHTYPE_FLAGS= -DCHTYPE_32
!endif
!ifdef ICC
CC = icl.exe -nologo
LINK = link.exe -nologo
!else
CC = cl.exe -nologo
LINK = link.exe -nologo
!endif
SHL_LD = $(LINK) $(LDFLAGS) -dll -machine:$(PLATFORM) -out:pdcurses.dll
CCLIBS = user32.lib advapi32.lib
# may need to add msvcrt for older compilers
#CCLIBS = msvcrt.lib user32.lib advapi32.lib
LIBEXE = lib -nologo
LIBCURSES = pdcurses.lib
CURSESDLL = pdcurses.dll
!ifdef DLL
DLLOPT = -DPDC_DLL_BUILD
PDCLIBS = $(CURSESDLL)
!else
PDCLIBS = $(LIBCURSES)
!endif
BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c $(CFLAGS) $(CHTYPE_FLAGS) $(DLLOPT) \
$(WIDEOPT) $(UTF8OPT)
all: $(PDCLIBS)
clean:
-$(RM) *.obj
-$(RM) *.lib
-$(RM) *.exe
-$(RM) *.dll
-$(RM) *.exp
-$(RM) *.res
demos: $(PDCLIBS) $(DEMOS)
DEMOOBJS = $(DEMOS:.exe=.obj) tui.obj
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_WIN_H)
$(DEMOOBJS) : $(PDCURSES_CURSES_H)
$(DEMOS) : $(LIBCURSES)
panel.obj : $(PANEL_HEADER)
terminfo.obj : $(TERM_HEADER)
!ifndef DLL
$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
$(LIBEXE) -out:$@ $(LIBOBJS) $(PDCOBJS)
!endif
$(CURSESDLL) : $(LIBOBJS) $(PDCOBJS) pdcurses.obj
$(SHL_LD) $(LIBOBJS) $(PDCOBJS) pdcurses.obj $(CCLIBS)
pdcurses.res pdcurses.obj: $(common)\pdcurses.rc
rc -r -fopdcurses.res $(common)\pdcurses.rc
cvtres -machine:$(PLATFORM) -nologo -out:pdcurses.obj pdcurses.res
{$(srcdir)\}.c{}.obj::
$(BUILD) $<
{$(osdir)\}.c{}.obj::
$(BUILD) $<
{$(demodir)\}.c{}.obj::
$(BUILD) $<
.obj.exe:
$(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS)
tuidemo.exe: tuidemo.obj tui.obj
$(LINK) $(LDFLAGS) $*.obj tui.obj $(LIBCURSES) $(CCLIBS)
tui.obj: $(demodir)\tui.c $(demodir)\tui.h
$(BUILD) -I$(demodir) $(demodir)\tui.c
tuidemo.obj: $(demodir)\tuidemo.c
$(BUILD) -I$(demodir) $(demodir)\tuidemo.c