build: Change ms nmake default to nasm and add pdb gen

The nmake default is changed for a modern nasm. Older nasm and yasm versions
will still work with windows but the nmake options must be changed appropriately
for max AS_FEATURE_LEVEL to match. Also now generates debug symbol pdb files.

Change-Id: I94a2dd7ecf541c6564ccbd4a184c33995d7b31ad
Signed-off-by: Poornima Kumar <poornima.kumar@intel.com>
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker 2020-03-30 15:41:31 -07:00
parent a2fc2c000d
commit 5e586843eb
2 changed files with 28 additions and 14 deletions

View File

@ -162,11 +162,16 @@ objs = \
bin\mem_multibinary.obj
INCLUDES = -I./ -Ierasure_code/ -Iraid/ -Icrc/ -Iigzip/ -Iprograms/ -Imem/ -Iinclude/ -Itests/fuzz/ -Iexamples/ec/
LINKFLAGS = /nologo
CFLAGS = -O2 -D NDEBUG /nologo -D_USE_MATH_DEFINES -Qstd=c99 $(INCLUDES) $(D)
AFLAGS = -f win64 $(INCLUDES) $(D)
CC = icl
AS = yasm
# Modern asm feature level, consider upgrading nasm/yasm before decreasing feature_level
FEAT_FLAGS = -DHAVE_AS_KNOWS_AVX512 -DAS_FEATURE_LEVEL=10
CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy
CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd
LINKFLAGS = -nologo -incremental:no -debug
CFLAGS = $(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $(FEAT_FLAGS) $(INCLUDES) $(D)
AFLAGS = -f win64 $(FEAT_FLAGS) $(INCLUDES) $(D)
CC = cl
# or CC = icl -Qstd=c99
AS = nasm
lib: bin static dll
static: bin isa-l_static.lib
@ -180,7 +185,7 @@ $?
<<
isa-l.dll: $(objs)
link -out:$@ -dll -def:isa-l.def @<<
link -out:$@ -dll -def:isa-l.def $(LINKFLAGS) @<<
$?
<<
@ -302,8 +307,10 @@ clean:
-if exist bin\*.obj del bin\*.obj
-if exist isa-l_static.lib del isa-l_static.lib
-if exist *.exe del *.exe
-if exist *.pdb del *.pdb
-if exist isa-l.lib del isa-l.lib
-if exist isa-l.dll del isa-l.dll
-if exist isa-l.exp del isa-l.exp
zlib.lib:
igzip_perf.exe: zlib.lib

View File

@ -12,11 +12,16 @@ Makefile.nmake: FORCE
@echo '' >> $@
@echo '' >> $@
@echo 'INCLUDES = $(INCLUDE)' >> $@
@echo 'LINKFLAGS = /nologo' >> $@
@echo 'CFLAGS = -O2 -D NDEBUG /nologo -D_USE_MATH_DEFINES -Qstd=c99 $$(INCLUDES) $$(D)' >> $@
@echo 'AFLAGS = -f win64 $$(INCLUDES) $$(D)' >> $@
@echo 'CC = icl' >> $@
@echo 'AS = yasm' >> $@
@echo '# Modern asm feature level, consider upgrading nasm/yasm before decreasing feature_level' >> $@
@echo 'FEAT_FLAGS = -DHAVE_AS_KNOWS_AVX512 -DAS_FEATURE_LEVEL=10' >> $@
@echo 'CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy' >> $@
@echo 'CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd' >> $@
@echo 'LINKFLAGS = -nologo -incremental:no -debug' >> $@
@echo 'CFLAGS = $$(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $$(FEAT_FLAGS) $$(INCLUDES) $$(D)' >> $@
@echo 'AFLAGS = -f win64 $$(FEAT_FLAGS) $$(INCLUDES) $$(D)' >> $@
@echo 'CC = cl' >> $@
@echo '# or CC = icl -Qstd=c99' >> $@
@echo 'AS = nasm' >> $@
@echo '' >> $@
@echo 'lib: bin static dll' >> $@
@echo 'static: bin isa-l_static.lib' >> $@
@ -30,7 +35,7 @@ Makefile.nmake: FORCE
@echo '<<' >> $@
@echo '' >> $@
@echo 'isa-l.dll: $$(objs)' >> $@
@echo ' link -out:$$@ -dll -def:isa-l.def @<<' >> $@
@echo ' link -out:$$@ -dll -def:isa-l.def $$(LINKFLAGS) @<<' >> $@
@echo '$$?' >> $@
@echo '<<' >> $@
@echo '' >> $@
@ -90,8 +95,10 @@ endif
@echo ' -if exist bin\*.obj del bin\*.obj' >> $@
@echo ' -if exist isa-l_static.lib del isa-l_static.lib' >> $@
@echo ' -if exist *.exe del *.exe' >> $@
@echo ' -if exist *.pdb del *.pdb' >> $@
@echo ' -if exist isa-l.lib del isa-l.lib' >> $@
@echo ' -if exist isa-l.dll del isa-l.dll' >> $@
@echo ' -if exist isa-l.exp del isa-l.exp' >> $@
@echo '' >> $@
$(if $(findstring igzip,$(units)),@echo 'zlib.lib:' >> $@ )
@cat $(foreach unit,$(units), $(unit)/Makefile.am) | sed \