fix testme.sh and compilation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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