Add toplevel header gen in windows

Change-Id: I3a1e5fc495266d8ba223d75384625e22c3cf66fe
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker
2021-05-06 14:59:00 -07:00
parent 2c705a26cb
commit fe4b7f9acc
2 changed files with 46 additions and 4 deletions

View File

@@ -175,8 +175,8 @@ CC = cl
AS = nasm
lib: bin static dll
static: bin isa-l_static.lib
dll: bin isa-l.dll
static: bin isa-l_static.lib isa-l.h
dll: bin isa-l.dll isa-l.h
bin: ; -mkdir $@
@@ -303,6 +303,30 @@ progs: lib $(progs)
igzip.exe: programs\igzip_cli.obj
link /out:$@ $(LINKFLAGS) isa-l.lib $?
isa-l.h:
@echo /**>> $@
@echo * @file isa-l.h>> $@
@echo * @brief Include for ISA-L library>> $@
@echo */>> $@
@echo.>> $@
@echo #ifndef _ISAL_H_>> $@
@echo #define _ISAL_H_>> $@
@echo.>> $@
@echo #define ISAL_MAJOR_VERSION 2 >> $@
@echo #define ISAL_MINOR_VERSION 30 >> $@
@echo #define ISAL_PATCH_VERSION 0 >> $@
@echo #define ISAL_MAKE_VERSION(maj, min, patch) ((maj) * 0x10000 + (min) * 0x100 + (patch))>> $@
@echo #define ISAL_VERSION ISAL_MAKE_VERSION(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION)>> $@
@echo.>> $@
@echo #include ^<isa-l/crc.h^>>> $@
@echo #include ^<isa-l/crc64.h^>>> $@
@echo #include ^<isa-l/erasure_code.h^>>> $@
@echo #include ^<isa-l/gf_vect_mul.h^>>> $@
@echo #include ^<isa-l/igzip_lib.h^>>> $@
@echo #include ^<isa-l/mem_routines.h^>>> $@
@echo #include ^<isa-l/raid.h^>>> $@
@echo #endif //_ISAL_H_>> $@
clean:
-if exist *.obj del *.obj
-if exist bin\*.obj del bin\*.obj

View File

@@ -31,8 +31,8 @@ Makefile.nmake tst.nmake: FORCE
@echo 'AS = nasm' >> $@
@echo '' >> $@
@echo 'lib: bin static dll' >> $@
@echo 'static: bin isa-l_static.lib' >> $@
@echo 'dll: bin isa-l.dll' >> $@
@echo 'static: bin isa-l_static.lib isa-l.h' >> $@
@echo 'dll: bin isa-l.dll isa-l.h' >> $@
@echo '' >> $@
@echo 'bin: ; -mkdir $$@' >> $@
@echo '' >> $@
@@ -97,6 +97,24 @@ endif
@$(foreach p, $(notdir $(bin_PROGRAMS)), \
printf "%s.exe: %s\n\tlink /out:\$$@ \$$(LINKFLAGS) isa-l.lib \$$?\n" $(p) $(subst /,\\,$(programs_$(p)_SOURCES:.c=.obj)) >> $@; )
@echo '' >> $@
@echo 'isa-l.h:' >> $@
@echo ' @echo /**>> $$@' >> $@
@echo ' @echo * @file isa-l.h>> $$@' >> $@
@echo ' @echo * @brief Include for ISA-L library>> $$@' >> $@
@echo ' @echo */>> $$@' >> $@
@echo ' @echo.>> $$@' >> $@
@echo ' @echo #ifndef _ISAL_H_>> $$@' >> $@
@echo ' @echo #define _ISAL_H_>> $$@' >> $@
@echo ' @echo.>> $$@' >> $@
@echo '#define.ISAL_MAJOR_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$3, ">> $$@"}' >> $@
@echo '#define.ISAL_MINOR_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$4, ">> $$@"}' >> $@
@echo '#define.ISAL_PATCH_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$5, ">> $$@"}' >> $@
@echo ' @echo #define ISAL_MAKE_VERSION(maj, min, patch) ((maj) * 0x10000 + (min) * 0x100 + (patch))>> $$@' >> $@
@echo ' @echo #define ISAL_VERSION ISAL_MAKE_VERSION(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION)>> $$@' >> $@
@echo ' @echo.>> $$@' >> $@
@for unit in $(sort $(extern_hdrs)); do echo " @echo #include ^<isa-l/$$unit^>>> \$$@" | sed -e 's;include/;;' >> $@; done
@echo ' @echo #endif //_ISAL_H_>> $$@' >> $@
@echo '' >> $@
@echo 'clean:' >> $@
@echo ' -if exist *.obj del *.obj' >> $@
@echo ' -if exist bin\*.obj del bin\*.obj' >> $@