Skip to content

Commit fe4b7f9

Browse files
committed
Add toplevel header gen in windows
Change-Id: I3a1e5fc495266d8ba223d75384625e22c3cf66fe Signed-off-by: Greg Tucker <[email protected]>
1 parent 2c705a2 commit fe4b7f9

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

Makefile.nmake

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ CC = cl
175175
AS = nasm
176176

177177
lib: bin static dll
178-
static: bin isa-l_static.lib
179-
dll: bin isa-l.dll
178+
static: bin isa-l_static.lib isa-l.h
179+
dll: bin isa-l.dll isa-l.h
180180

181181
bin: ; -mkdir $@
182182

@@ -303,6 +303,30 @@ progs: lib $(progs)
303303
igzip.exe: programs\igzip_cli.obj
304304
link /out:$@ $(LINKFLAGS) isa-l.lib $?
305305

306+
isa-l.h:
307+
@echo /**>> $@
308+
@echo * @file isa-l.h>> $@
309+
@echo * @brief Include for ISA-L library>> $@
310+
@echo */>> $@
311+
@echo.>> $@
312+
@echo #ifndef _ISAL_H_>> $@
313+
@echo #define _ISAL_H_>> $@
314+
@echo.>> $@
315+
@echo #define ISAL_MAJOR_VERSION 2 >> $@
316+
@echo #define ISAL_MINOR_VERSION 30 >> $@
317+
@echo #define ISAL_PATCH_VERSION 0 >> $@
318+
@echo #define ISAL_MAKE_VERSION(maj, min, patch) ((maj) * 0x10000 + (min) * 0x100 + (patch))>> $@
319+
@echo #define ISAL_VERSION ISAL_MAKE_VERSION(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION)>> $@
320+
@echo.>> $@
321+
@echo #include ^<isa-l/crc.h^>>> $@
322+
@echo #include ^<isa-l/crc64.h^>>> $@
323+
@echo #include ^<isa-l/erasure_code.h^>>> $@
324+
@echo #include ^<isa-l/gf_vect_mul.h^>>> $@
325+
@echo #include ^<isa-l/igzip_lib.h^>>> $@
326+
@echo #include ^<isa-l/mem_routines.h^>>> $@
327+
@echo #include ^<isa-l/raid.h^>>> $@
328+
@echo #endif //_ISAL_H_>> $@
329+
306330
clean:
307331
-if exist *.obj del *.obj
308332
-if exist bin\*.obj del bin\*.obj

tools/gen_nmake.mk

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Makefile.nmake tst.nmake: FORCE
3131
@echo 'AS = nasm' >> $@
3232
@echo '' >> $@
3333
@echo 'lib: bin static dll' >> $@
34-
@echo 'static: bin isa-l_static.lib' >> $@
35-
@echo 'dll: bin isa-l.dll' >> $@
34+
@echo 'static: bin isa-l_static.lib isa-l.h' >> $@
35+
@echo 'dll: bin isa-l.dll isa-l.h' >> $@
3636
@echo '' >> $@
3737
@echo 'bin: ; -mkdir $$@' >> $@
3838
@echo '' >> $@
@@ -97,6 +97,24 @@ endif
9797
@$(foreach p, $(notdir $(bin_PROGRAMS)), \
9898
printf "%s.exe: %s\n\tlink /out:\$$@ \$$(LINKFLAGS) isa-l.lib \$$?\n" $(p) $(subst /,\\,$(programs_$(p)_SOURCES:.c=.obj)) >> $@; )
9999
@echo '' >> $@
100+
@echo 'isa-l.h:' >> $@
101+
@echo ' @echo /**>> $$@' >> $@
102+
@echo ' @echo * @file isa-l.h>> $$@' >> $@
103+
@echo ' @echo * @brief Include for ISA-L library>> $$@' >> $@
104+
@echo ' @echo */>> $$@' >> $@
105+
@echo ' @echo.>> $$@' >> $@
106+
@echo ' @echo #ifndef _ISAL_H_>> $$@' >> $@
107+
@echo ' @echo #define _ISAL_H_>> $$@' >> $@
108+
@echo ' @echo.>> $$@' >> $@
109+
@echo '#define.ISAL_MAJOR_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$3, ">> $$@"}' >> $@
110+
@echo '#define.ISAL_MINOR_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$4, ">> $$@"}' >> $@
111+
@echo '#define.ISAL_PATCH_VERSION.${version}' | ${AWK} -F . '{print "\t@echo", $$1, $$2, $$5, ">> $$@"}' >> $@
112+
@echo ' @echo #define ISAL_MAKE_VERSION(maj, min, patch) ((maj) * 0x10000 + (min) * 0x100 + (patch))>> $$@' >> $@
113+
@echo ' @echo #define ISAL_VERSION ISAL_MAKE_VERSION(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION)>> $$@' >> $@
114+
@echo ' @echo.>> $$@' >> $@
115+
@for unit in $(sort $(extern_hdrs)); do echo " @echo #include ^<isa-l/$$unit^>>> \$$@" | sed -e 's;include/;;' >> $@; done
116+
@echo ' @echo #endif //_ISAL_H_>> $$@' >> $@
117+
@echo '' >> $@
100118
@echo 'clean:' >> $@
101119
@echo ' -if exist *.obj del *.obj' >> $@
102120
@echo ' -if exist bin\*.obj del bin\*.obj' >> $@

0 commit comments

Comments
 (0)