NASM 0.95
[platform/upstream/nasm.git] / Makefile.sc
1 # Makefile for the Netwide Assembler under 32-bit Windows(tm)
2
3 #
4
5 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
6
7 # Julian Hall. All rights reserved. The software is
8
9 # redistributable under the licence given in the file "Licence"
10
11 # distributed in the NASM archive.
12
13 #
14
15 # This Makefile is designed to build NASM using the 32-bit WIN32 C
16
17 # compiler Symantec(tm) C++ 7.5, provided you have a MAKE-utility
18
19 # that's compatible to SMAKE.
20
21
22
23 CC = sc
24
25 CCFLAGS = -c -a1 -mn -Nc -w2 -w7 -o+time -5
26
27 # -5            optimize for pentium (tm)
28
29 # -c            compile only
30
31 # -o-all        no optimizations (to avoid problems in disasm.c)
32
33 # -o+time       optimize for speed
34
35 # -o+space      optimize for size
36
37 # -A1           byte alignment for structures
38
39 # -mn           compile for Win32 executable
40
41 # -Nc           create COMDAT records
42
43 # -w2           possible unattended assignment: off
44
45 # -w7           for loops with empty instruction-body
46
47
48
49 LINK = link
50
51 LINKFLAGS = /noi /exet:NT /su:console
52
53 # /noignorecase all symbols are case-sensitive
54
55 # /exet:NT      Exetype: NT (Win32)
56
57 # /su:console   Subsystem: Console (Console-App)
58
59
60
61 LIBRARIES =
62
63 EXE = .exe
64
65 OBJ = obj
66
67
68
69 .c.$(OBJ):
70
71         $(CC) $(CCFLAGS) $*.c
72
73
74
75
76
77 #
78
79 # modules needed for different programs
80
81 #
82
83
84
85 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
86
87            assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
88
89            outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \
90
91            outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \
92
93            preproc.$(OBJ) listing.$(OBJ)
94
95
96
97 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
98
99               insnsd.$(OBJ)
100
101
102
103
104
105 #
106
107 # programs to create
108
109 #
110
111
112
113 all : nasm$(EXE) ndisasm$(EXE)
114
115
116
117
118
119 #
120
121 # We have to have a horrible kludge here to get round the 128 character
122
123 # limit, as usual... we'll simply use LNK-files :)
124
125 #
126
127 nasm$(EXE): $(NASMOBJS)
128
129         $(LINK) $(LINKFLAGS) @<<
130
131 $(NASMOBJS)
132
133 nasm.exe;
134
135 <<
136
137
138
139 ndisasm$(EXE): $(NDISASMOBJS)
140
141         $(LINK) $(LINKFLAGS) @<<
142
143 $(NDISASMOBJS)
144
145 ndisasm.exe;
146
147 <<
148
149
150
151
152
153
154
155 #
156
157 # modules for programs
158
159 #
160
161
162
163 disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c
164
165 assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h
166
167 float.$(OBJ): float.c nasm.h
168
169 labels.$(OBJ): labels.c nasm.h nasmlib.h
170
171 listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h
172
173 nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \
174
175         listing.h outform.h
176
177 nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h
178
179 ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h
180
181 outas86.$(OBJ): outas86.c nasm.h nasmlib.h
182
183 outaout.$(OBJ): outaout.c nasm.h nasmlib.h
184
185 outbin.$(OBJ): outbin.c nasm.h nasmlib.h
186
187 outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h
188
189 outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h
190
191 outelf.$(OBJ): outelf.c nasm.h nasmlib.h
192
193 outobj.$(OBJ): outobj.c nasm.h nasmlib.h
194
195 outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h
196
197 outform.$(OBJ): outform.c outform.h nasm.h
198
199 parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c
200
201 preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h
202
203 sync.$(OBJ): sync.c sync.h
204
205 insnsa.$(OBJ): insnsa.c nasm.h insns.h
206
207 insnsd.$(OBJ): insnsd.c nasm.h insns.h
208
209
210
211
212
213
214
215 clean :
216
217         del *.obj
218
219         del nasm$(EXE)
220
221         del ndisasm$(EXE)
222