Sfoglia il codice sorgente

don't include testprof for library build

...well msvc still does it as I can't test it...
Steffen Jaeckel 8 anni fa
parent
commit
8ee458b625
6 ha cambiato i file con 56 aggiunte e 15 eliminazioni
  1. 5 1
      makefile
  2. 8 1
      makefile.include
  3. 14 2
      makefile.mingw
  4. 1 1
      makefile.msvc
  5. 7 2
      makefile.shared
  6. 21 8
      makefile.unix

+ 5 - 1
makefile

@@ -225,12 +225,16 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22
 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
 
+$(DOBJECTS): CFLAGS += -Itestprof
+$(TOBJECTS): CFLAGS += -Itestprof
+
 #This rule makes the libtomcrypt library.
 library: $(LIBNAME)
 
 #Dependencies on *.h
 $(OBJECTS): $(HEADERS)
-$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
+$(DOBJECTS): $(HEADERS) $(THEADERS)
+$(TOBJECTS): $(HEADERS) $(THEADERS)
 
 $(LIBNAME): $(OBJECTS)
 ifneq ($V,1)

+ 8 - 1
makefile.include

@@ -30,7 +30,7 @@ endif
 
 
 # Compilation flags. Note the += does not write over the user's CFLAGS!
-CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
+CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
 
 ifdef OLD_GCC
 CFLAGS += -W
@@ -84,6 +84,13 @@ CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
 endif
 
 
+#List of demo objects
+DSOURCES != ls demos/*.c
+DOBJECTS = ${DSOURCES:.c=.o}
+
+#List of testprof headers
+THEADERS != ls testprof/*.h
+
 TIMING=timing
 TEST=test
 

+ 14 - 2
makefile.mingw

@@ -27,7 +27,7 @@ CFLAGS    = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
 EXTRALIBS = -L../libtommath -ltommath
 
 #Compilation flags
-LTC_CFLAGS  = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE
+LTC_CFLAGS  = $(CFLAGS) -Isrc/headers -DLTC_SOURCE
 LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
 
 #Libraries to be created
@@ -203,6 +203,16 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma
 src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
 src/headers/tomcrypt_prng.h
 
+THEADERS != ls testprof/*.h
+
+#List of demo objects (only used to create a special rule to extend LTC_CFLAGS)
+DSOURCES != ls demos/*.c
+DOBJECTS = ${DSOURCES:.c=.o}
+
+#SPECIAL: demo- and test-objects required include-path "testprof"
+$(DOBJECTS): LTC_CFLAGS += -Itestprof
+$(TOBJECTS): LTC_CFLAGS += -Itestprof
+
 .c.o:
 	$(CC) $(LTC_CFLAGS) -c $< -o $@
 
@@ -222,9 +232,11 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22
 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
 
+
 #Dependencies on *.h
 $(OBJECTS): $(HEADERS)
-$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
+$(DOBJECTS): $(HEADERS) $(THEADERS)
+$(TOBJECTS): $(HEADERS) $(THEADERS)
 
 #Create libtomcrypt_prof.a
 $(LIBTEST_S): $(TOBJECTS)

+ 1 - 1
makefile.msvc

@@ -186,7 +186,7 @@ src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
 
 library: $(OBJECTS) $(TOBJECTS)
 	lib /out:tomcrypt.lib $(OBJECTS)
-        lib /out:tomcrypt_prof.lib $(TOBJECTS)
+	lib /out:tomcrypt_prof.lib $(TOBJECTS)
 
 tv_gen: demos/tv_gen.c library
 	cl $(CFLAGS) demos/tv_gen.c tomcrypt.lib advapi32.lib $(EXTRALIBS)

+ 7 - 2
makefile.shared

@@ -203,7 +203,7 @@ src/headers/tomcrypt_prng.h
 #END_INS
 
 #The default rule for make builds the libtomcrypt library.
-default:library
+default: library
 
 #ciphers come in two flavours... enc+dec and enc
 src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
@@ -223,7 +223,12 @@ library: $(LIBNAME)
 
 #Dependencies on *.h
 $(OBJECTS): $(HEADERS)
-$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
+$(DOBJECTS): $(HEADERS) $(THEADERS)
+$(TOBJECTS): $(HEADERS) $(THEADERS)
+
+#SPECIAL: demo- and test-objects required include-path "testprof"
+$(DOBJECTS): CFLAGS += -Itestprof
+$(TOBJECTS): CFLAGS += -Itestprof
 
 .c.o:
 	$(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $<

+ 21 - 8
makefile.unix

@@ -32,7 +32,7 @@ CFLAGS    = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
 EXTRALIBS = ../libtommath/libtommath.a
 
 #Compilation flags
-LTC_CFLAGS  = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE
+LTC_CFLAGS  = $(CFLAGS) -Isrc/headers -DLTC_SOURCE
 LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
 VERSION=1.17
 
@@ -207,14 +207,10 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma
 src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
 src/headers/tomcrypt_prng.h
 
-#This is necessary for compatibility with BSD make (namely on OpenBSD)
-.SUFFIXES: .o .c
-
-.c.o:
-	$(CC) $(LTC_CFLAGS) -c $< -o $@
+THEADERS != ls testprof/*.h
 
 #The default rule for make builds the libtomcrypt.a library (static)
-default: $(LIBMAIN_S)
+default: library
 
 #SPECIAL: AES comes in two flavours - enc+dec and enc-only
 src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
@@ -229,9 +225,26 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22
 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
 
+#List of demo objects (only used to create a special rule to extend LTC_CFLAGS)
+DSOURCES != ls demos/*.c
+DOBJECTS = ${DSOURCES:.c=.o}
+
+#This rule makes the libtomcrypt library.
+library: $(LIBMAIN_S)
+
 #Dependencies on *.h
 $(OBJECTS): $(HEADERS)
-$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
+$(DOBJECTS): $(HEADERS) $(THEADERS)
+$(TOBJECTS): $(HEADERS) $(THEADERS)
+
+#SPECIAL: demo- and test-objects required include-path "testprof"
+$(DOBJECTS): LTC_CFLAGS += -Itestprof
+$(TOBJECTS): LTC_CFLAGS += -Itestprof
+
+#This is necessary for compatibility with BSD make (namely on OpenBSD)
+.SUFFIXES: .o .c
+.c.o:
+	$(CC) $(LTC_CFLAGS) -c $< -o $@
 
 #Create libtomcrypt_prof.a
 $(LIBTEST_S): $(TOBJECTS)