@@ -22,25 +22,25 @@ MANIFEST_FLAGS = /MANIFEST:EMBED /MANIFESTFILE:$(MANIFEST)
22
22
23
23
!IF "$(DEBUG)" == "1"
24
24
CFLAGS = /Od /Zi
25
- LDFLAGS = /DEBUG $( MANIFEST_FLAGS )
25
+ LDFLAGS = /DEBUG
26
26
!ELSE
27
27
CFLAGS = /O2 /Zi
28
28
# /OPT:REF and /OPT:ICF two undo /DEBUG harm
29
- LDFLAGS = /DEBUG /OPT:REF /OPT:ICF $( MANIFEST_FLAGS )
29
+ LDFLAGS = /DEBUG /OPT:REF /OPT:ICF
30
30
!ENDIF
31
31
32
32
CC = cl
33
33
AR = lib
34
- CFLAGS = $(CFLAGS ) /W2
35
- BUILD_CFLAGS = $(CFLAGS )
34
+ BUILD_CFLAGS = $(CFLAGS ) /W2
36
35
INTERNAL_CFLAGS = /I$(srcdir ) /I. \
37
36
/I$(srcdir ) /include /I./include \
38
37
/I$(srcdir ) /x86 /I./x86 \
39
38
/I$(srcdir ) /asm /I./asm \
40
39
/I$(srcdir ) /disasm /I./disasm \
41
40
/I$(srcdir ) /output /I./output
42
41
ALL_CFLAGS = $(BUILD_CFLAGS ) $(INTERNAL_CFLAGS )
43
- LDFLAGS = /link $(LINKFLAGS ) /SUBSYSTEM:CONSOLE /RELEASE
42
+ MANIFEST_FLAGS = /MANIFEST:EMBED /MANIFESTINPUT:$(MANIFEST )
43
+ ALL_LDFLAGS = /link $(LDFLAGS ) $(MANIFEST_FLAGS ) /SUBSYSTEM:CONSOLE /RELEASE
44
44
LIBS =
45
45
46
46
PERL = perl
@@ -57,7 +57,7 @@ O = obj
57
57
A = lib
58
58
X = .exe
59
59
.SUFFIXES :
60
- .SUFFIXES : $(X ) .$(A ) .$( O ) .c .i .s .1 .man
60
+ .SUFFIXES : $(X ) .$(A ) .obj .c .i .s .1 .man
61
61
62
62
.c.obj :
63
63
$(CC ) /c $(ALL_CFLAGS ) /Fo$@ $<
@@ -66,61 +66,62 @@ MANIFEST = win/manifest.xml
66
66
67
67
# -- Begin File Lists --#
68
68
# Edit in Makefile.in, not here!
69
- NASM = asm\nasm.$( O )
70
- NDISASM = disasm\ndisasm.$( O )
69
+ NASM = asm\nasm.obj
70
+ NDISASM = disasm\ndisasm.obj
71
71
72
72
PROGOBJ = $(NASM ) $(NDISASM )
73
73
PROGS = nasm$(X ) ndisasm$(X )
74
74
75
- LIBOBJ_NW = stdlib\snprintf.$( O ) stdlib\vsnprintf.$( O ) stdlib\strlcpy.$( O ) \
76
- stdlib\strnlen.$( O ) stdlib\strrchrnul.$( O ) \
75
+ LIBOBJ_NW = stdlib\snprintf.obj stdlib\vsnprintf.obj stdlib\strlcpy.obj \
76
+ stdlib\strnlen.obj stdlib\strrchrnul.obj \
77
77
\
78
- nasmlib\ver.$( O ) \
79
- nasmlib\alloc.$( O ) nasmlib\asprintf.$( O ) nasmlib\errfile.$( O ) \
80
- nasmlib\crc32.$( O ) nasmlib\crc64.$( O ) nasmlib\md5c.$( O ) \
81
- nasmlib\string.$( O ) nasmlib\nctype.$( O ) \
82
- nasmlib\file.$( O ) nasmlib\mmap.$( O ) nasmlib\ilog2.$( O ) \
83
- nasmlib\realpath.$( O ) nasmlib\path.$( O ) \
84
- nasmlib\filename.$( O ) nasmlib\rlimit.$( O ) \
85
- nasmlib\readnum.$( O ) nasmlib\numstr.$( O ) \
86
- nasmlib\zerobuf.$( O ) nasmlib\bsi.$( O ) \
87
- nasmlib\rbtree.$( O ) nasmlib\hashtbl.$( O ) \
88
- nasmlib\raa.$( O ) nasmlib\saa.$( O ) \
89
- nasmlib\strlist.$( O ) \
90
- nasmlib\perfhash.$( O ) nasmlib\badenum.$( O ) \
78
+ nasmlib\ver.obj \
79
+ nasmlib\alloc.obj nasmlib\asprintf.obj nasmlib\errfile.obj \
80
+ nasmlib\crc32.obj nasmlib\crc64.obj nasmlib\md5c.obj \
81
+ nasmlib\string.obj nasmlib\nctype.obj \
82
+ nasmlib\file.obj nasmlib\mmap.obj nasmlib\ilog2.obj \
83
+ nasmlib\realpath.obj nasmlib\path.obj \
84
+ nasmlib\filename.obj nasmlib\rlimit.obj \
85
+ nasmlib\readnum.obj nasmlib\numstr.obj \
86
+ nasmlib\zerobuf.obj nasmlib\bsi.obj \
87
+ nasmlib\rbtree.obj nasmlib\hashtbl.obj \
88
+ nasmlib\raa.obj nasmlib\saa.obj \
89
+ nasmlib\strlist.obj \
90
+ nasmlib\perfhash.obj nasmlib\badenum.obj \
91
91
\
92
- common\common.$( O ) \
92
+ common\common.obj \
93
93
\
94
- x86\insnsa.$( O ) x86\insnsb.$( O ) x86\insnsd.$( O ) x86\insnsn.$( O ) \
95
- x86\regs.$( O ) x86\regvals.$( O ) x86\regflags.$( O ) x86\regdis.$( O ) \
96
- x86\disp8.$( O ) x86\iflag.$( O ) \
94
+ x86\insnsa.obj x86\insnsb.obj x86\insnsd.obj x86\insnsn.obj \
95
+ x86\regs.obj x86\regvals.obj x86\regflags.obj x86\regdis.obj \
96
+ x86\disp8.obj x86\iflag.obj \
97
97
\
98
- asm\error.$( O ) \
99
- asm\floats.$( O ) \
100
- asm\directiv.$( O ) asm\directbl.$( O ) \
101
- asm\pragma.$( O ) \
102
- asm\assemble.$( O ) asm\labels.$( O ) asm\parser.$( O ) \
103
- asm\preproc.$( O ) asm\quote.$( O ) asm\pptok.$( O ) \
104
- asm\listing.$( O ) asm\eval.$( O ) asm\exprlib.$( O ) asm\exprdump.$( O ) \
105
- asm\stdscan.$( O ) \
106
- asm\strfunc.$( O ) asm\tokhash.$( O ) \
107
- asm\segalloc.$( O ) \
108
- asm\rdstrnum.$( O ) \
109
- asm\srcfile.$( O ) \
110
- macros\macros.$( O ) \
98
+ asm\error.obj \
99
+ asm\floats.obj \
100
+ asm\directiv.obj asm\directbl.obj \
101
+ asm\pragma.obj \
102
+ asm\assemble.obj asm\labels.obj asm\parser.obj \
103
+ asm\preproc.obj asm\quote.obj asm\pptok.obj \
104
+ asm\listing.obj asm\eval.obj asm\exprlib.obj asm\exprdump.obj \
105
+ asm\stdscan.obj \
106
+ asm\strfunc.obj asm\tokhash.obj \
107
+ asm\segalloc.obj \
108
+ asm\rdstrnum.obj \
109
+ asm\srcfile.obj \
110
+ macros\macros.obj \
111
111
\
112
- output\outform.$( O ) output\outlib.$( O ) output\legacy.$( O ) \
113
- output\nulldbg.$( O ) output\nullout.$( O ) \
114
- output\outbin.$( O ) output\outaout.$( O ) output\outcoff.$( O ) \
115
- output\outelf.$( O ) \
116
- output\outobj.$( O ) output\outas86.$( O ) \
117
- output\outdbg.$( O ) output\outieee.$( O ) output\outmacho.$( O ) \
118
- output\codeview.$( O ) \
112
+ output\outform.obj output\outlib.obj output\legacy.obj \
113
+ output\nulldbg.obj output\nullout.obj \
114
+ output\outbin.obj output\outaout.obj output\outcoff.obj \
115
+ output\outelf.obj \
116
+ output\outobj.obj output\outas86.obj \
117
+ output\outdbg.obj output\outieee.obj output\outmacho.obj \
118
+ output\codeview.obj \
119
119
\
120
- disasm\disasm.$( O ) disasm\sync.$( O )
120
+ disasm\disasm.obj disasm\sync.obj
121
121
122
122
# Warnings depend on all source files, so handle them separately
123
- WARNOBJ = asm\warnings.$(O )
123
+ WARNOBJ = asm\warnings.obj
124
+ WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
124
125
125
126
LIBOBJ = $(LIBOBJ_NW ) $(WARNOBJ )
126
127
ALLOBJ_NW = $(PROGOBJ ) $(LIBOBJ_NW )
@@ -136,14 +137,18 @@ NASMLIB = libnasm.$(A)
136
137
all : nasm$(X ) ndisasm$(X )
137
138
138
139
nasm$(X ) : $(NASM ) $(MANIFEST ) $(NASMLIB )
139
- $(CC ) /Fe$@ $(NASM ) $(LDFLAGS ) $(NASMLIB ) $(LIBS )
140
+ $(CC ) /Fe$@ $(NASM ) $(ALL_LDFLAGS ) $(NASMLIB ) $(LIBS )
140
141
141
142
ndisasm$(X ) : $(NDISASM ) $(MANIFEST ) $(NASMLIB )
142
- $(CC ) /Fe$@ $(NDISASM ) $(LDFLAGS ) $(NASMLIB ) $(LIBS )
143
+ $(CC ) /Fe$@ $(NDISASM ) $(ALL_LDFLAGS ) $(NASMLIB ) $(LIBS )
143
144
144
145
$(NASMLIB ) : $(LIBOBJ )
145
146
$(AR ) $(ARFLAGS ) /OUT:$@ $* *
146
147
148
+ # These are specific to certain Makefile syntaxes...
149
+ WARNTIMES = $(patsubst % ,% .time,$(WARNFILES ) )
150
+ WARNSRCS = $(patsubst % .obj,% .c,$(LIBOBJ_NW ) )
151
+
147
152
# -- Begin Generated File Rules --#
148
153
# Edit in Makefile.in, not here!
149
154
@@ -238,33 +243,31 @@ x86\regs.h: x86\regs.dat x86\regs.pl
238
243
# reasonable, but doesn't update the time stamp if the files aren't
239
244
# changed, to avoid rebuilding everything every time. Track the actual
240
245
# dependency by the empty file asm\warnings.time.
241
- WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
242
-
243
246
warnings :
244
- $(RM_F ) $(WARNFILES ) $(WARNFILES:=.time )
247
+ $(RM_F ) $(WARNFILES ) $(WARNTIMES )
245
248
$(MAKE ) asm\w arnings.time
246
249
247
250
asm\warnings.time : $(ALLOBJ_NW:.$(O ) =.c )
248
- : > asm\w arnings.time
249
- $(MAKE ) $(WARNFILES:=.time )
251
+ $( EMPTY ) asm\w arnings.time
252
+ $(MAKE ) $(WARNTIMES )
250
253
251
254
asm\warnings_c.h.time : asm\warnings.pl asm\warnings.time
252
255
$(RUNPERL ) $(srcdir ) \a sm\w arnings.pl c asm\w arnings_c.h $(srcdir )
253
- : > asm\w arnings_c.h.time
256
+ $( EMPTY ) asm\w arnings_c.h.time
254
257
255
258
asm\warnings_c.h : asm\warnings_c.h.time
256
259
@: Side effect
257
260
258
261
include\warnings.h.time : asm\warnings.pl asm\warnings.time
259
262
$(RUNPERL ) $(srcdir ) \a sm\w arnings.pl h include\w arnings.h $(srcdir )
260
- : > include\w arnings.h.time
263
+ $( EMPTY ) include\w arnings.h.time
261
264
262
265
include\warnings.h : include\warnings.h.time
263
266
@: Side effect
264
267
265
268
doc\warnings.src.time : asm\warnings.pl asm\warnings.time
266
269
$(RUNPERL ) $(srcdir ) \a sm\w arnings.pl doc doc\w arnings.src $(srcdir )
267
- : > doc\w arnings.src.time
270
+ $( EMPTY ) doc\w arnings.src.time
268
271
269
272
doc\warnings.src : doc\warnings.src.time
270
273
@: Side effect
@@ -326,7 +329,7 @@ nsis: nsis\nasm.nsi nsis\arch.nsh nsis\version.nsh
326
329
# -- End NSIS Rules --#
327
330
328
331
clean :
329
- -del /f /s * .$( O )
332
+ -del /f /s * .obj
330
333
-del /f /s * .pdb
331
334
-del /f /s * .s
332
335
-del /f /s * .i
@@ -348,7 +351,7 @@ distclean: clean
348
351
-del /f output\* .bak
349
352
-del /f test\* .lst
350
353
-del /f test\* .bin
351
- -del /f test\* .$( O )
354
+ -del /f test\* .obj
352
355
-del /f test\* .bin
353
356
-del /f/s autom4te* .cache
354
357
@@ -403,7 +406,7 @@ MKDEP=0
403
406
!ENDIF
404
407
405
408
# -- Magic hints to mkdep.pl --#
406
- # @object-ending: ".$(O) "
409
+ # @object-ending: ".obj "
407
410
# @path-separator: "\"
408
411
# @exclude: "config/config.h"
409
412
# @external: "msvc.dep"
0 commit comments