I am writing my first makefile, and I face a problem:
all: sequential pthreads1 pthreads2 openmp1 openmp2
sequential: sequential/main.c sequential/definitions.h
gcc -o seq sequential/main.c
pthreads1: pthreads1/main.c pthreads1/definitions.h
gcc -o pthr1 pthreads1/main.c -lpthread
pthreads2: pthreads2/main.c pthreads2/definitions.h
gcc -o pthr2 pthreads2/main.c -lpthread
openmp1: openmp1/main.c openmp1/definitions.h
gcc -o open1 openmp1/main.c -fopenmp
openmp2: openmp2/main.c openmp2/definitions.h
gcc -o open2 openmp2/main.c -fopenmp
clean:
rm -f seq pthr1 pthr2 open1 open2
force:
cd sequential; touch *
cd pthreads1; touch *
cd pthreads2; touch *
cd openmp1; touch *
cd openmp2; touch *
make all
Why make force doesn't compile openmp2?
EDIT: Problem solved. I had forgotten to put the lines in bold.