mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-10-10 00:25:06 -04:00
Makefile: a few more portability improvements
Define macros for generating an empty file and for a dummy (side effect) target. Tweak MSVC compiler options. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
@@ -47,6 +47,7 @@ PERLFLAGS = -I$(top_srcdir)/perllib -I$(srcdir)
|
||||
RUNPERL = $(PERL) $(PERLFLAGS)
|
||||
|
||||
EMPTY = : >
|
||||
SIDE = @: Generated by side effect
|
||||
|
||||
PYTHON3 = python3
|
||||
|
||||
@@ -360,7 +361,7 @@ asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
|
||||
$(EMPTY) asm/warnings_c.h.time
|
||||
|
||||
asm/warnings_c.h: asm/warnings_c.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
include/warnings.h.time: asm/warnings.pl asm/warnings.time
|
||||
$(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h \
|
||||
@@ -368,7 +369,7 @@ include/warnings.h.time: asm/warnings.pl asm/warnings.time
|
||||
$(EMPTY) include/warnings.h.time
|
||||
|
||||
include/warnings.h: include/warnings.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
doc/warnings.src.time: asm/warnings.pl asm/warnings.time
|
||||
$(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src \
|
||||
@@ -376,7 +377,7 @@ doc/warnings.src.time: asm/warnings.pl asm/warnings.time
|
||||
$(EMPTY) doc/warnings.src.time
|
||||
|
||||
doc/warnings.src : doc/warnings.src.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
# Assembler token hash
|
||||
asm/tokhash.c: x86/insns.xda x86/insnsn.c asm/tokens.dat asm/tokhash.pl \
|
||||
|
@@ -21,10 +21,10 @@ mandir = $(prefix)/man
|
||||
MANIFEST_FLAGS = /manifest:embed /manifestfile:$(MANIFEST)
|
||||
|
||||
!IF "$(DEBUG)" == "1"
|
||||
OPTFLAGS = /Od /Zi
|
||||
OPTFLAGS = /Od
|
||||
LDFLAGS = /debug
|
||||
!ELSE
|
||||
CFLAGS = /O2 /Zi
|
||||
OPTFLAGS = /O2
|
||||
# /OPT:REF and /OPT:ICF two undo /DEBUG harm
|
||||
LDFLAGS = /debug /opt:ref /opt:icf
|
||||
!ENDIF
|
||||
@@ -33,6 +33,7 @@ CC = cl
|
||||
AR = lib
|
||||
ARFLAGS = /nologo
|
||||
|
||||
CFLAGS = $(OPTFLAGS) /Zi /nologo /std:c11 /bigobj
|
||||
BUILD_CFLAGS = $(CFLAGS) /W2
|
||||
INTERNAL_CFLAGS = /I$(srcdir) /I. \
|
||||
/I$(srcdir)/include /I./include \
|
||||
@@ -52,8 +53,10 @@ RUNPERL = $(PERL) $(PERLFLAGS)
|
||||
|
||||
MAKENSIS = makensis
|
||||
|
||||
RM_F = -del /f
|
||||
LN_S = copy
|
||||
RM_F = -del /s /f /q
|
||||
LN_S = copy /y
|
||||
EMPTY = copy /y nul:
|
||||
SIDE = @rem Created by side effect
|
||||
|
||||
# Binary suffixes
|
||||
O = obj
|
||||
@@ -308,7 +311,7 @@ asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) asm\warnings_c.h.time
|
||||
|
||||
asm\warnings_c.h: asm\warnings_c.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h \
|
||||
@@ -316,7 +319,7 @@ include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) include\warnings.h.time
|
||||
|
||||
include\warnings.h: include\warnings.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
doc\warnings.src.time: asm\warnings.pl asm\warnings.time
|
||||
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src \
|
||||
@@ -324,7 +327,7 @@ doc\warnings.src.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) doc\warnings.src.time
|
||||
|
||||
doc\warnings.src : doc\warnings.src.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
# Assembler token hash
|
||||
asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl \
|
||||
|
@@ -28,12 +28,19 @@ PERL = perl
|
||||
PERLFLAGS = -I$(srcdir)\perllib -I$(srcdir)
|
||||
RUNPERL = $(PERL) $(PERLFLAGS)
|
||||
|
||||
EMPTY = $(RUNPERL) -e ""
|
||||
.BEFORE
|
||||
set COPYCMD=/y
|
||||
|
||||
RM_F = -del /f
|
||||
LN_S = copy
|
||||
EMPTY = copy nul:
|
||||
SIDE = @rem Created by side effect
|
||||
|
||||
MAKENSIS = makensis
|
||||
|
||||
# Binary suffixes
|
||||
O = obj
|
||||
A = lib
|
||||
X = .exe
|
||||
|
||||
# WMAKE errors out if a suffix is declared more than once, including
|
||||
@@ -41,7 +48,7 @@ X = .exe
|
||||
# first. Also, WMAKE only allows implicit rules that point "to the left"
|
||||
# in this list!
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .man .1 .obj .i .c
|
||||
.SUFFIXES: .man .1 .obj .i .c .lib .exe
|
||||
|
||||
# Needed to find C files anywhere but in the current directory
|
||||
.c : $(VPATH)
|
||||
@@ -319,7 +326,7 @@ asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) asm\warnings_c.h.time
|
||||
|
||||
asm\warnings_c.h: asm\warnings_c.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(RUNPERL) $(srcdir)\asm\warnings.pl h include\warnings.h &
|
||||
@@ -327,7 +334,7 @@ include\warnings.h.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) include\warnings.h.time
|
||||
|
||||
include\warnings.h: include\warnings.h.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
doc\warnings.src.time: asm\warnings.pl asm\warnings.time
|
||||
$(RUNPERL) $(srcdir)\asm\warnings.pl doc doc\warnings.src &
|
||||
@@ -335,7 +342,7 @@ doc\warnings.src.time: asm\warnings.pl asm\warnings.time
|
||||
$(EMPTY) doc\warnings.src.time
|
||||
|
||||
doc\warnings.src : doc\warnings.src.time
|
||||
@: Side effect
|
||||
$(SIDE)
|
||||
|
||||
# Assembler token hash
|
||||
asm\tokhash.c: x86\insns.xda x86\insnsn.c asm\tokens.dat asm\tokhash.pl &
|
||||
|
Reference in New Issue
Block a user