Commit a7d5af27a3b0b356e2ad582507f9458f63d71456

Steffen Jaeckel 2017-04-01T00:34:19

fix testme.sh and compilation

diff --git a/makefile b/makefile
index f19afce..1a1664e 100644
--- a/makefile
+++ b/makefile
@@ -8,12 +8,6 @@ else
 silent=@
 endif
 
-%.o: %.c
-ifneq ($V,1)
-	@echo "   * ${CC} $@"
-endif
-	${silent} ${CC} -c ${CFLAGS} $^ -o $@
-
 #default files to install
 ifndef LIBNAME
    LIBNAME=libtommath.a
@@ -23,6 +17,12 @@ coverage: LIBNAME:=-Wl,--whole-archive $(LIBNAME)  -Wl,--no-whole-archive
 
 include makefile.include
 
+%.o: %.c
+ifneq ($V,1)
+	@echo "   * ${CC} $@"
+endif
+	${silent} ${CC} -c ${CFLAGS} $< -o $@
+
 LCOV_ARGS=--directory .
 
 #START_INS
@@ -53,6 +53,8 @@ bn_s_mp_sqr.o bn_s_mp_sub.o
 
 #END_INS
 
+$(OBJECTS): $(HEADERS)
+
 $(LIBNAME):  $(OBJECTS)
 	$(AR) $(ARFLAGS) $@ $(OBJECTS)
 	$(RANLIB) $@
diff --git a/testme.sh b/testme.sh
index 6324525..67d55d0 100755
--- a/testme.sh
+++ b/testme.sh
@@ -113,7 +113,7 @@ do
       COMPILERS="gcc clang"
       ARCHFLAGS="-m64 -m32 -mx32"
     ;;
-    --help)
+    --help | -h)
       _help
     ;;
   esac
@@ -158,7 +158,7 @@ do
 
   for a in "${archflags[@]}"
   do
-    if [[ $(expr "$i" : "clang") && "$a" == "-mx32" ]]
+    if [[ $(expr "$i" : "clang") -ne 0 && "$a" == "-mx32" ]]
     then
       echo "clang -mx32 tests skipped"
       continue