summaryrefslogtreecommitdiffstats
path: root/private/nw/nw16/tsr/makefile
blob: 61ae19b1235e753378ca4a34684a9bedd0ebe316 (plain) (blame)
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
!IF 0

Copyright (c) 1991 & 1993  Microsoft Corporation

Module Name:

    makefile

Abstract:

    makefile for Vdm NetWare Redir program

Author:

    Richard L Firth (rfirth) 13-Sep-1991

Revision History:

    13-Sep-1991 rfirth
        Created

!ENDIF



.SUFFIXES:
.SUFFIXES:  .asm .h

#
# nmake doesn't work properly if we try to stick the objects in obj, so put
# them in current dir for now. WHEN CHANGE OBJPATH TO BE OBJ, CHANGE clean TOO
#

#OBJPATH     = .
OBJPATH     = obj

ASM         = masm
!IFDEF NTVDM_BASED_BUILD
LINK        = link16
!ELSE
LINK        = link
!ENDIF

#
# set the country info
#

!if "$(LANGUAGE)" == "JPN"
COUNTRY=jpn
!elseif "$(LANGUAGE)" == "CHT"
COUNTRY=cht
!elseif "$(LANGUAGE)" == "CHS"
COUNTRY=chs
!elseif "$(LANGUAGE)" == "KOR"
COUNTRY=kor
!ENDIF

!IFNDEF COUNTRY
COUNTRY=usa
!ENDIF

#
# convert NTDEBUG into DEBUG flag. NTDEBUG can be not present or retail, either
# of which mean no debugging; or ntsd, cvp or sym, which means debugging support
# required
#

!IFDEF NTDEBUG
!IF "$(NTDEBUG)" == "retail"
DEBUGGING=0
!ELSE
DEBUGGING=1
!ENDIF
!ELSE
DEBUGGING=0
!ENDIF

#
# assembler and linker debugging options
#

!IF $(DEBUGGING)
ASMDEBUG    = /DDEBUG=1 /Zi
LINKDEBUG   = /CO
!ELSE
ASMDEBUG    = /DDEBUG=0
LINKDEBUG   =
!ENDIF
ASMINC      = /I$(_NTROOT)\public\sdk\inc /I$(_NTROOT)\private\mvdm\dos\v86\inc /I..\..\inc /I..\inc
ASMFLAGS    = /Mx
LINKFLAGS   = /MAP /CP:1

#
# any other non-debug related options (for assembler) go in USERDEFS
#

#USERDEFS    = /DCALL_DOS /DVERBOSE
#USERDEFS    = /DCALL_DOS



#
# Inference rules - asm to obj, h to inc
#

.asm{$(OBJPATH)\}.obj:
    $(ASM) $(ASMINC) $(ASMDEBUG) $(USERDEFS) $<,$@;

.asm.lst:
    $(ASM) $(ASMINC) $(ASMDEBUG) $(USERDEFS) /L $<;



#
# what it is we're building
#

TARGET      = $(OBJPATH)\nw16.exe
MAPFILE     = $(TARGET:.exe=.map)
DEFFILE     = ;

OBJS        = $(OBJPATH)\nw16.obj       \
              $(OBJPATH)\resident.obj

LIBS        =



#
# how to build it
#

all:    makedir $(TARGET)

$(TARGET):  $(OBJS)
    $(LINK) @<<
$(OBJS)
$(TARGET) $(LINKFLAGS) $(LINKDEBUG)
$(MAPFILE)
$(LIBS)
$(DEFFILE)
<<


#
# where to put it
#

    binplace $(TARGET)


#
# clean build - delete all objs
#

#clean:  makedir clean2
clean:  clean2

clean2:
    if exist $(OBJPATH)\*.obj del $(OBJPATH)\*.obj
    $(MAKE)

#
# makedir - ensure the subdirectory for the object files exists
#

makedir:
    @-if not exist $(OBJPATH) md $(OBJPATH)



#
# file dependencies
#

$(OBJPATH)\nw16.obj:            \
        nw16.asm                \
        debugmac.inc            \
        asmmacro.inc            \
        segorder.inc            \
        messages.inc            \
        ..\inc\nwdos.inc

$(OBJPATH)\resident.obj:        \
        resident.asm            \
        segorder.inc            \
        debugmac.inc            \
        asmmacro.inc            \
        ..\inc\nwdos.inc

messages.inc: ..\..\inc\$(COUNTRY)\messages.inc
    copy ..\..\inc\$(COUNTRY)\messages.inc .