#  POSIX imposes the use of the POSIX suggested   -lpthread
#  GCC   supports                   -pthread  and -lpthread
#  -pthread  .is.equivalent.to                    -lpthread  plus more.
#  Usage : I use  -lpthread 
#
#  make clean ; make all
all:	all0 all1
all0:	t1  t2  t3  t4  t5  t6  t7  t8  t21 t22 t23 t24 t29
all1:	all11 all12 all13
t1:
	gcc -std=c11 -Wall -Wextra -pedantic thread01.c -lpthread -o t01
t2:
	gcc -std=c11 -Wall -Wextra -pedantic thread02.c -lpthread -o t02
t3:
	gcc -std=c11 -Wall -Wextra -pedantic thread03.c -lpthread -o t03
t4:
	gcc -std=c11 -Wall -Wextra -pedantic thread04.c -lpthread -o t04
t5:
	gcc -std=c11 -Wall -Wextra -pedantic thread05.c -lpthread -o t05
t6:
	gcc -std=c11 -Wall -Wextra -pedantic thread06.c -lpthread -o t06
t7:
	gcc -std=c11 -Wall -Wextra -pedantic thread07.c -lpthread -o t07
t8:
	gcc -std=c11 -Wall -Wextra -pedantic thread08.c -lpthread -o t08
t9:
	gcc -std=c11 -Wall -Wextra -pedantic thread09.c -lpthread -o t09
t21:
	gcc -std=c11 -Wall -Wextra -pedantic thread21.c -lpthread -o t21
t22:
	gcc -std=c11 -Wall -Wextra -pedantic thread22.c -lpthread -o t22
t23:
	gcc -std=c11 -Wall -Wextra -pedantic thread23.c -lpthread -o t23
t24:
	gcc -std=c11 -Wall -Wextra -pedantic thread24.c -lpthread -o t24
t29:
	gcc -std=c11 -Wall -Wextra -pedantic thread29.c -lpthread -o t29
#  Example of using -pthread instead
alt:
	gcc -pthread -D NTHREADS=10 thread01.c -o t01x
#  Generates multiple executables for multiple used defined number of threads
all11:
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=1 thread11.c -lpthread -o t111
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=2 thread11.c -lpthread -o t112
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=4 thread11.c -lpthread -o t114
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=8 thread11.c -lpthread -o t118
all12:
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=1 thread12.c -lpthread -o t121
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=2 thread12.c -lpthread -o t122
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=4 thread12.c -lpthread -o t124
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=8 thread12.c -lpthread -o t128
all13:
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=1 thread13.c -lpthread -o t131
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=2 thread13.c -lpthread -o t132
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=4 thread13.c -lpthread -o t134
	gcc -std=c11 -Wall -Wextra -pedantic -D NTHREADS=8 thread13.c -lpthread -o t138
clean:
	rm -rf t0* t1* t2*
