summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.Makefile.common6
-rw-r--r--Makefile11
-rw-r--r--set1/Makefile3
3 files changed, 15 insertions, 5 deletions
diff --git a/.Makefile.common b/.Makefile.common
index a5eee02..01e3f6c 100644
--- a/.Makefile.common
+++ b/.Makefile.common
@@ -1,8 +1,8 @@
## define variables used in all makefiles
-LIB=../lib/lib2.c ../lib/lib.c ../lib/lib3.c ../lib/lib4.c
+LIB=../lib/lib2.c ../lib/lib.c ../lib/lib3.c ../lib/lib4.c ../lib/sha1.c ../lib/md4.c ../lib/lib5.c
CC=gcc
-CFLAGS := -g $(CFLAGS)
-CLIBS=`pkg-config --cflags --libs libcrypto`
+CFLAGS := -g -fPIC $(CFLAGS)
+CLIBS=`pkg-config --cflags --libs libcrypto` -lgmp -lm
%: %.c
@echo -e "\tCC\t $<"
diff --git a/Makefile b/Makefile
index 68cf09c..48e08c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,19 @@
# call all makefiles in sudirs
-DIRS = set1 set2 set3
+DIRS = set1 set2 set3 set4
compile:
- @for i in $(DIRS); do \
+ @+for i in $(DIRS); do \
echo "Compiling $$i:"; \
make -s -C $$i ;\
done
+test:
+ @for i in $(DIRS); do \
+ cd $$i; \
+ sh ./test.sh; \
+ cd ./../; \
+ done
+
clean:
@for i in $(DIRS); do \
echo "Cleaning $$i:"; \
diff --git a/set1/Makefile b/set1/Makefile
index 8b0ffbd..1b13d72 100644
--- a/set1/Makefile
+++ b/set1/Makefile
@@ -4,6 +4,9 @@ TARGETS=$(shell find . -type f -name "task*.c" | sed "s/\(.*\)\.c/\1/g")
all: $(TARGETS)
+test:
+ @sh ./test.sh
+
clean:
@echo -e "\tDEL\t$(TARGETS)"
@rm $(TARGETS)