Skip to content

Commit 8ae1b63

Browse files
committed
fix build make files
1 parent 55ac25d commit 8ae1b63

File tree

3 files changed

+86
-32
lines changed

3 files changed

+86
-32
lines changed

Mkfiles/msvc.mak

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ PROGS = nasm$(X) ndisasm$(X)
8989
# Files dependent on extracted warnings
9090
WARNOBJ = asm\warnings.obj
9191
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
92+
WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time
9293

9394
OUTPUTOBJ = \
9495
output\outform.obj output\outlib.obj \
@@ -205,7 +206,7 @@ $(NDISLIB): $(LIBOBJ_DIS)
205206
$(AR) $(ARFLAGS) /out:$@ $**
206207

207208
# These are specific to certain Makefile syntaxes...
208-
WARNSRCS = $(LIBOBJ_NW:.c=.obj)
209+
WARNSRCS = $(ALLOBJ_W:.obj=.c)
209210

210211
#-- Begin Generated File Rules --#
211212
# Edit in Makefile.in, not here!
@@ -333,6 +334,34 @@ asm\directbl.c: asm\directiv.dat nasmlib\perfhash.pl perllib\phash.ph
333334
$(RUNPERL) $(srcdir)\nasmlib\perfhash.pl c \
334335
$(srcdir)\asm\directiv.dat asm\directbl.c
335336

337+
warnings: .SYMBOLIC
338+
$(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time
339+
%make asm\warnings.time
340+
341+
asm\warnings.time: $(WARNTIMES) asm\warnings.pl $(WARNSRCS)
342+
$(EMPTY) asm\warnings.time
343+
344+
asm\warnings_c.h.time: asm\warnings_c.h
345+
$(EMPTY) asm\warnings_c.h.time
346+
347+
asm\warnings_c.h: asm\warnings.pl $(WARNSRCS)
348+
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h \
349+
$(srcdir) $(WARNSRCS)
350+
351+
include\warnings.h.time: include\warnings.h
352+
$(EMPTY) include\warnings.h.time
353+
354+
include\warnings.h: asm\warnings.pl $(WARNSRCS)
355+
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h \
356+
$(srcdir) $(WARNSRCS)
357+
358+
doc\warnings.src.time: doc\warnings.src
359+
$(EMPTY) doc\warnings.src.time
360+
361+
doc\warnings.src : asm\warnings.pl $(WARNSRCS)
362+
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src \
363+
$(srcdir) $(WARNSRCS)
364+
336365
# Editor token files
337366
editors\nasmtok.el: editors\nasmtok.pl asm\tokhash.c asm\pptok.c \
338367
asm\directiv.dat macros\macros.c editors\builtin.mac \

Mkfiles/openwcom.mak

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUNPERL = $(PERL) $(PERLFLAGS)
3333

3434
RM_F = -del /f
3535
LN_S = copy
36-
EMPTY = copy nul:
36+
EMPTY = %create
3737
SIDE = %null Created by side effect
3838

3939
MAKENSIS = makensis
@@ -74,6 +74,7 @@ PROGS = nasm$(X) ndisasm$(X)
7474
# Files dependent on extracted warnings
7575
WARNOBJ = asm\warnings.obj
7676
WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
77+
WARNTIMES = asm\warnings_c.h.time include\warnings.h.time doc\warnings.src.time
7778

7879
OUTPUTOBJ = &
7980
output\outform.obj output\outlib.obj &
@@ -213,8 +214,7 @@ ndisasm.lib: $(LIBOBJ_DIS)
213214

214215
# These are specific to certain Makefile syntaxes (what are they
215216
# actually supposed to look like for wmake?)
216-
WARNTIMES = $(WARNFILES:=.time)
217-
WARNSRCS = $(LIBOBJ_NW:.obj=.c)
217+
WARNSRCS = $(ALLOBJ_W:.obj=.c)
218218

219219
#-- Begin Generated File Rules --#
220220
# Edit in Makefile.in, not here!
@@ -357,6 +357,34 @@ editors: $(EDITORS)
357357

358358
#-- End Generated File Rules --#
359359

360+
warnings: .SYMBOLIC
361+
$(RM_F) $(WARNFILES) $(WARNTIMES) asm\warnings.time
362+
%make asm\warnings.time
363+
364+
asm\warnings.time: $(WARNTIMES) asm\warnings.pl $(WARNSRCS)
365+
$(EMPTY) asm\warnings.time
366+
367+
asm\warnings_c.h.time: asm\warnings_c.h
368+
$(EMPTY) asm\warnings_c.h.time
369+
370+
asm\warnings_c.h: asm\warnings.pl $(WARNSRCS)
371+
$(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h &
372+
$(srcdir) $(WARNSRCS)
373+
374+
include\warnings.h.time: include\warnings.h
375+
$(EMPTY) include\warnings.h.time
376+
377+
include\warnings.h: asm\warnings.pl $(WARNSRCS)
378+
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h &
379+
$(srcdir) $(WARNSRCS)
380+
381+
doc\warnings.src.time: doc\warnings.src
382+
$(EMPTY) doc\warnings.src.time
383+
384+
doc\warnings.src : asm\warnings.pl $(WARNSRCS)
385+
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src &
386+
$(srcdir) $(WARNSRCS)
387+
360388
perlreq: $(PERLREQ) .SYMBOLIC
361389

362390
#-- Begin NSIS Rules --#

asm/assemble.c

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -561,24 +561,24 @@ static void out(struct out_data *data)
561561
if (debug_current_macro)
562562
debug_macro_out(data);
563563

564-
if (unlikely(data->type == OUT_ZERODATA) &&
564+
if (unlikely(data->type == OUT_ZERODATA) &&
565565
!(ofmt->flags & OFMT_ZERODATA)) {
566-
/*
567-
* Break OFMT_ZERODATA up into ZERO_BUF_SIZE chunks unless the
568-
* backend has indicated it can handle arbitrary sizes
569-
* by setting the OFMT_ZERODATA flag.
570-
*/
571-
uint64_t size = data->size;
572-
while (size > ZERO_BUF_SIZE) {
573-
data->type = OUT_ZERODATA; /* Help the compiler? */
574-
data->size = ZERO_BUF_SIZE;
575-
nasm_ofmt_output(data);
576-
size -= ZERO_BUF_SIZE;
577-
data->loc.offset += ZERO_BUF_SIZE;
578-
data->insoffs += ZERO_BUF_SIZE;
579-
}
580-
data->size = size;
581-
}
566+
/*
567+
* Break OFMT_ZERODATA up into ZERO_BUF_SIZE chunks unless the
568+
* backend has indicated it can handle arbitrary sizes
569+
* by setting the OFMT_ZERODATA flag.
570+
*/
571+
uint64_t size = data->size;
572+
while (size > ZERO_BUF_SIZE) {
573+
data->type = OUT_ZERODATA; /* Help the compiler? */
574+
data->size = ZERO_BUF_SIZE;
575+
nasm_ofmt_output(data);
576+
size -= ZERO_BUF_SIZE;
577+
data->loc.offset += ZERO_BUF_SIZE;
578+
data->insoffs += ZERO_BUF_SIZE;
579+
}
580+
data->size = size;
581+
}
582582
nasm_ofmt_output(data);
583583
} else {
584584
/* Outputting to ABSOLUTE section - only reserve is permitted */
@@ -1501,7 +1501,7 @@ static int64_t calcsize(insn *ins, const struct itemplate * const temp)
15011501
int opt_opsize = 0;
15021502

15031503
ins->rex = 0; /* Ensure REX is reset */
1504-
ins->evex = 0; /* Ensure EVEX is reset */
1504+
ins->evex = 0; /* Ensure EVEX is reset */
15051505
ins->vexreg = 0; /* No V register */
15061506
ins->vex_cm = 0; /* No implicit map */
15071507
ins->bits = bits; /* Execution mode (default asize) */
@@ -2443,7 +2443,7 @@ static int emit_prefixes(struct out_data *data, const insn *ins)
24432443
}
24442444
}
24452445

2446-
/* Various warnings and error conditions */
2446+
/* Various warnings and error conditions */
24472447
switch ((int)pfx) {
24482448
case R_CS:
24492449
case R_DS:
@@ -2475,13 +2475,13 @@ static int emit_prefixes(struct out_data *data, const insn *ins)
24752475
case P_A64:
24762476
if (bits != 64)
24772477
nasm_nonfatal("64-bit addressing is only supported "
2478-
"in 64-bit mode");
2478+
"in 64-bit mode");
24792479
break;
24802480

24812481
case P_O64:
24822482
if (bits != 64)
24832483
nasm_nonfatal("64-bit operand size is only supported "
2484-
"in 64-bit mode");
2484+
"in 64-bit mode");
24852485
break;
24862486

24872487
default:
@@ -3275,18 +3275,15 @@ static enum match_result matches(const struct itemplate * const itemp,
32753275
* allow it to match an extending pattern.
32763276
*/
32773277
switch (isize[i]) {
3278-
case BITS8:
3278+
if( isize[i] == BITS8 ) {
32793279
if (ttype & BYTEEXTMASK) {
32803280
isize[i] = tsize[i];
32813281
itype[i] |= BYTEEXTMASK;
32823282
}
3283-
break;
3284-
case BITS32:
3285-
if (ttype & DWORDEXTMASK)
3283+
} else if( isize[i] == BITS32 ) {
3284+
if (ttype & DWORDEXTMASK) {
32863285
isize[i] = tsize[i];
3287-
break;
3288-
default:
3289-
break;
3286+
}
32903287
}
32913288

32923289
/*

0 commit comments

Comments
 (0)