diff options
| author | Benedict <benedict@0xb8000.de> | 2016-11-14 23:12:41 +0100 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:26 +0100 |
| commit | 21ccda3438ad27d53678965d237732a0b3aae5c7 (patch) | |
| tree | 0928de8b21ec1648bfc0e11097404a7a2df79af3 | |
| parent | b1e61efdf366bd7591b64161b010b4c72a6a394e (diff) | |
makefile: added dependenies + resepect -j flag
| -rw-r--r-- | .Makefile.common | 6 | ||||
| -rw-r--r-- | Makefile | 11 | ||||
| -rw-r--r-- | 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 $<" @@ -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) |
