Browse Source

update icc makefiles to current compiler versions

As the current icc can act as a gcc drop-in, I took over all compile flags
from the standard makefile.

The "-x?" options have been deprecated, so they're updated.

The "-xP" has been removed, since it makes no sense in my eyes to define
the optimization for a specific architecture in the makefile.
Steffen Jaeckel 11 years ago
parent
commit
1f96647d70
2 changed files with 22 additions and 17 deletions
  1. 21 16
      makefile.icc
  2. 1 1
      testprof/makefile.icc

+ 21 - 16
makefile.icc

@@ -18,16 +18,16 @@ CC=icc
 #LD=ld
 #LD=ld
 
 
 # Archiver [makes .a files]
 # Archiver [makes .a files]
+# With compile option "-ipo" it can be necessary to archive with 'xiar'
 #AR=ar
 #AR=ar
 #ARFLAGS=r
 #ARFLAGS=r
 
 
-# Compilation flags. Note the += does not write over the user's CFLAGS!
-CFLAGS += -c -Isrc/headers/ -Itestprof/ -DINTEL_CC -DLTC_SOURCE
+ifndef MAKE
+  MAKE=make
+endif
 
 
-#ICC v9 doesn't support LTC_FAST for things like Pelican MAC
-#Despite the fact I can't see what's wrong with my code
-#Oh well
-CFLAGS += -DLTC_NO_FAST
+# Compilation flags. Note the += does not write over the user's CFLAGS!
+CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE
 
 
 #The default rule for make builds the libtomcrypt library.
 #The default rule for make builds the libtomcrypt library.
 default:library
 default:library
@@ -35,23 +35,28 @@ default:library
 # optimize for SPEED
 # optimize for SPEED
 #
 #
 # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
 # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
-# -ax?	specifies make code specifically for ? but compatible with IA-32
-# -x?	   specifies compile solely for ? [not specifically IA-32 compatible]
+# -a?	specifies make code specifically for ? but compatible with IA-32
+# -?	   specifies compile solely for ? [not specifically IA-32 compatible]
 #
 #
 # where ? is
 # where ? is
-#	K - PIII
-#	W - first P4 [Williamette]
-#	N - P4 Northwood
-#	P - P4 Prescott
-#	B - Blend of P4 and PM [mobile]
+#	mia   - PIII; has only option "-mia32", no "-amia32"
+#	msse2 - first P4 [Willamette]; has only option "-msse2", no "-amsse2"
+#	xSSE2 - P4 Northwood
+#	xSSE3 - P4 Prescott
+#
+# The easiest way - when compiling on one architecture, only for
+# this architecture - is to enable the compiler option "-fast", which enables
+# "all possible" optimizations for this architecture.
+# ICC 14.0.3 20140422 says "-fast" resolves to
+# "-xHOST -O3 -ipo -no-prec-div -static"
 #
 #
 # Default to just generic max opts
 # Default to just generic max opts
 ifdef LTC_SMALL
 ifdef LTC_SMALL
-CFLAGS += -O2 -xP -ip
+CFLAGS += -O1
 endif
 endif
 
 
 ifndef IGNORE_SPEED
 ifndef IGNORE_SPEED
-CFLAGS += -O3 -xP -ip
+CFLAGS += -O3
 endif
 endif
 
 
 # want to see stuff?
 # want to see stuff?
@@ -267,7 +272,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
 library: $(LIBNAME)
 library: $(LIBNAME)
 
 
 testprof/$(LIBTEST):
 testprof/$(LIBTEST):
-	cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" make -f makefile.icc
+	cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" CC="$(CC)" AR="$(AR)" $(MAKE) -f makefile.icc
 
 
 $(LIBNAME): $(OBJECTS)
 $(LIBNAME): $(OBJECTS)
 	$(AR) $(ARFLAGS) $@ $(OBJECTS)
 	$(AR) $(ARFLAGS) $@ $(OBJECTS)

+ 1 - 1
testprof/makefile.icc

@@ -1,5 +1,5 @@
 CFLAGS += -I../src/headers -I./ 
 CFLAGS += -I../src/headers -I./ 
-CC=icc
+CC?=icc
 
 
 OBJECTS = base64_test.o cipher_hash_test.o der_tests.o                                   \
 OBJECTS = base64_test.o cipher_hash_test.o der_tests.o                                   \
 dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o                   \
 dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o                   \