From 21ccda3438ad27d53678965d237732a0b3aae5c7 Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 14 Nov 2016 23:12:41 +0100 Subject: makefile: added dependenies + resepect -j flag --- .Makefile.common | 6 +++--- Makefile | 11 +++++++++-- set1/Makefile | 3 +++ 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) -- cgit v1.2.3-70-g09d2