1######################################################################## 2# Copyright(c) 2011-2016 Intel Corporation All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# * Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# * Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in 11# the documentation and/or other materials provided with the 12# distribution. 13# * Neither the name of Intel Corporation nor the names of its 14# contributors may be used to endorse or promote products derived 15# from this software without specific prior written permission. 16# 17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28######################################################################## 29 30objs = \ 31 bin\ec_base.obj \ 32 bin\ec_highlevel_func.obj \ 33 bin\ec_multibinary.obj \ 34 bin\gf_2vect_dot_prod_avx.obj \ 35 bin\gf_2vect_dot_prod_avx2.obj \ 36 bin\gf_2vect_dot_prod_avx512.obj \ 37 bin\gf_2vect_dot_prod_sse.obj \ 38 bin\gf_2vect_mad_avx.obj \ 39 bin\gf_2vect_mad_avx2.obj \ 40 bin\gf_2vect_mad_avx512.obj \ 41 bin\gf_2vect_mad_sse.obj \ 42 bin\gf_3vect_dot_prod_avx.obj \ 43 bin\gf_3vect_dot_prod_avx2.obj \ 44 bin\gf_3vect_dot_prod_avx512.obj \ 45 bin\gf_3vect_dot_prod_sse.obj \ 46 bin\gf_3vect_mad_avx.obj \ 47 bin\gf_3vect_mad_avx2.obj \ 48 bin\gf_3vect_mad_avx512.obj \ 49 bin\gf_3vect_mad_sse.obj \ 50 bin\gf_4vect_dot_prod_avx.obj \ 51 bin\gf_4vect_dot_prod_avx2.obj \ 52 bin\gf_4vect_dot_prod_avx512.obj \ 53 bin\gf_4vect_dot_prod_sse.obj \ 54 bin\gf_4vect_mad_avx.obj \ 55 bin\gf_4vect_mad_avx2.obj \ 56 bin\gf_4vect_mad_avx512.obj \ 57 bin\gf_4vect_mad_sse.obj \ 58 bin\gf_5vect_dot_prod_avx.obj \ 59 bin\gf_5vect_dot_prod_avx2.obj \ 60 bin\gf_5vect_dot_prod_sse.obj \ 61 bin\gf_5vect_mad_avx.obj \ 62 bin\gf_5vect_mad_avx2.obj \ 63 bin\gf_5vect_mad_sse.obj \ 64 bin\gf_6vect_dot_prod_avx.obj \ 65 bin\gf_6vect_dot_prod_avx2.obj \ 66 bin\gf_6vect_dot_prod_sse.obj \ 67 bin\gf_6vect_mad_avx.obj \ 68 bin\gf_6vect_mad_avx2.obj \ 69 bin\gf_6vect_mad_sse.obj \ 70 bin\gf_vect_dot_prod_avx.obj \ 71 bin\gf_vect_dot_prod_avx2.obj \ 72 bin\gf_vect_dot_prod_avx512.obj \ 73 bin\gf_vect_dot_prod_sse.obj \ 74 bin\gf_vect_mad_avx.obj \ 75 bin\gf_vect_mad_avx2.obj \ 76 bin\gf_vect_mad_avx512.obj \ 77 bin\gf_vect_mad_sse.obj \ 78 bin\gf_vect_mul_avx.obj \ 79 bin\gf_vect_mul_sse.obj \ 80 bin\pq_check_sse.obj \ 81 bin\pq_gen_avx.obj \ 82 bin\pq_gen_avx2.obj \ 83 bin\pq_gen_avx512.obj \ 84 bin\pq_gen_sse.obj \ 85 bin\raid_base.obj \ 86 bin\raid_multibinary.obj \ 87 bin\xor_check_sse.obj \ 88 bin\xor_gen_avx.obj \ 89 bin\xor_gen_avx512.obj \ 90 bin\xor_gen_sse.obj \ 91 bin\crc16_t10dif_01.obj \ 92 bin\crc16_t10dif_by4.obj \ 93 bin\crc16_t10dif_copy_by4.obj \ 94 bin\crc32_gzip.obj \ 95 bin\crc32_ieee_01.obj \ 96 bin\crc32_ieee_by4.obj \ 97 bin\crc32_iscsi_00.obj \ 98 bin\crc32_iscsi_01.obj \ 99 bin\crc64_base.obj \ 100 bin\crc64_ecma_norm_by8.obj \ 101 bin\crc64_ecma_refl_by8.obj \ 102 bin\crc64_iso_norm_by8.obj \ 103 bin\crc64_iso_refl_by8.obj \ 104 bin\crc64_jones_norm_by8.obj \ 105 bin\crc64_jones_refl_by8.obj \ 106 bin\crc64_multibinary.obj \ 107 bin\crc_base.obj \ 108 bin\crc32_gzip_base.obj \ 109 bin\crc_multibinary.obj \ 110 bin\huff_codes.obj \ 111 bin\hufftables_c.obj \ 112 bin\igzip.obj \ 113 bin\igzip_base.obj \ 114 bin\igzip_body_01.obj \ 115 bin\igzip_body_02.obj \ 116 bin\igzip_body_04.obj \ 117 bin\igzip_decode_block_stateless_01.obj \ 118 bin\igzip_decode_block_stateless_04.obj \ 119 bin\igzip_finish.obj \ 120 bin\flatten_ll.obj \ 121 bin\encode_df.obj \ 122 bin\encode_df_04.obj \ 123 bin\proc_heap.obj \ 124 bin\igzip_icf_body_h1_gr_bt.obj \ 125 bin\igzip_icf_finish.obj \ 126 bin\igzip_icf_base.obj \ 127 bin\igzip_inflate.obj \ 128 bin\igzip_inflate_multibinary.obj \ 129 bin\igzip_multibinary.obj \ 130 bin\igzip_update_histogram_01.obj \ 131 bin\igzip_update_histogram_04.obj \ 132 bin\rfc1951_lookup.obj \ 133 bin\detect_repeated_char.obj \ 134 bin\crc32_gzip_refl_by8.obj \ 135 bin\adler32_sse.obj \ 136 bin\adler32_avx2_4.obj \ 137 bin\igzip_deflate_hash.obj \ 138 bin\igzip_gen_icf_map_lh1_06.obj \ 139 bin\igzip_set_long_icf_fg_06.obj \ 140 bin\igzip_icf_body.obj 141 142INCLUDES = -I./ -Ierasure_code/ -Iraid/ -Icrc/ -Iigzip/ -Iinclude/ 143LINKFLAGS = /nologo 144CFLAGS = -O2 -D NDEBUG /nologo -D_USE_MATH_DEFINES -Qstd=c99 $(INCLUDES) $(D) 145AFLAGS = -f win64 $(INCLUDES) $(D) 146CC = icl 147AS = yasm 148 149lib: bin static dll 150static: bin isa-l_static.lib 151dll: bin isa-l.dll 152 153bin: ; -mkdir $@ 154 155isa-l_static.lib: $(objs) 156 lib -out:$@ @<< 157$? 158<< 159 160isa-l.dll: $(objs) 161 link -out:$@ -dll -def:isa-l.def @<< 162$? 163<< 164 165{erasure_code}.c.obj: 166 $(CC) $(CFLAGS) /c -Fo$@ $? 167{erasure_code}.asm.obj: 168 $(AS) $(AFLAGS) -o $@ $? 169 170{raid}.c.obj: 171 $(CC) $(CFLAGS) /c -Fo$@ $? 172{raid}.asm.obj: 173 $(AS) $(AFLAGS) -o $@ $? 174 175{crc}.c.obj: 176 $(CC) $(CFLAGS) /c -Fo$@ $? 177{crc}.asm.obj: 178 $(AS) $(AFLAGS) -o $@ $? 179 180{igzip}.c.obj: 181 $(CC) $(CFLAGS) /c -Fo$@ $? 182{igzip}.asm.obj: 183 $(AS) $(AFLAGS) -o $@ $? 184 185 186# Examples 187ex = xor_example.exe crc_simple_test.exe crc64_example.exe igzip_example.exe igzip_sync_flush_example.exe 188ex: lib $(ex) 189 190$(ex): $(@B).obj 191 192.obj.exe: 193 link /out:$@ $(LINKFLAGS) isa-l.lib $? 194 195# Check tests 196checks = \ 197 gf_vect_mul_test.exe \ 198 erasure_code_test.exe \ 199 gf_inverse_test.exe \ 200 erasure_code_update_test.exe \ 201 xor_gen_test.exe \ 202 pq_gen_test.exe \ 203 xor_check_test.exe \ 204 pq_check_test.exe \ 205 crc16_t10dif_test.exe \ 206 crc16_t10dif_copy_test.exe \ 207 crc32_ieee_test.exe \ 208 crc32_iscsi_test.exe \ 209 crc64_funcs_test.exe \ 210 igzip_rand_test.exe \ 211 crc32_gzip_refl_test.exe 212 213checks: lib $(checks) 214$(checks): $(@B).obj 215check: $(checks) 216 !$? 217 218# Unit tests 219tests = \ 220 gf_vect_mul_base_test.exe \ 221 gf_vect_dot_prod_base_test.exe \ 222 gf_vect_dot_prod_test.exe \ 223 gf_vect_mad_test.exe \ 224 erasure_code_base_test.exe 225 226tests: lib $(tests) 227$(tests): $(@B).obj 228 229# Performance tests 230perfs = \ 231 gf_vect_mul_perf.exe \ 232 gf_vect_mul_sse_perf.exe \ 233 gf_vect_mul_avx_perf.exe \ 234 gf_vect_dot_prod_sse_perf.exe \ 235 gf_vect_dot_prod_avx_perf.exe \ 236 gf_2vect_dot_prod_sse_perf.exe \ 237 gf_3vect_dot_prod_sse_perf.exe \ 238 gf_4vect_dot_prod_sse_perf.exe \ 239 gf_5vect_dot_prod_sse_perf.exe \ 240 gf_6vect_dot_prod_sse_perf.exe \ 241 gf_vect_dot_prod_perf.exe \ 242 gf_vect_dot_prod_1tbl.exe \ 243 gf_vect_mad_perf.exe \ 244 erasure_code_perf.exe \ 245 erasure_code_base_perf.exe \ 246 erasure_code_sse_perf.exe \ 247 erasure_code_update_perf.exe \ 248 xor_gen_perf.exe \ 249 pq_gen_perf.exe \ 250 crc16_t10dif_perf.exe \ 251 crc32_ieee_perf.exe \ 252 crc32_iscsi_perf.exe \ 253 igzip_perf.exe \ 254 igzip_sync_flush_perf.exe \ 255 crc32_gzip_refl_perf.exe 256 257perfs: lib $(perfs) 258$(perfs): $(@B).obj 259 260clean: 261 -if exist *.obj del *.obj 262 -if exist bin\*.obj del bin\*.obj 263 -if exist isa-l_static.lib del isa-l_static.lib 264 -if exist *.exe del *.exe 265 -if exist isa-l.lib del isa-l.lib 266 -if exist isa-l.dll del isa-l.dll 267 268zlib.lib: 269igzip_inflate_perf.exe: zlib.lib 270igzip_inflate_test.exe: zlib.lib 271