help with makefile

I am new to creating makefiles.

I have several fortran programs in a folder called as "test" and also have several subroutines in another folder (which is inside this test folder) called as libry

My makefile is in the folder "test"

I want to create a makefile which can access the files in test folder and also in libry folder to create a.out file.

please give me the suitable commands.
I tried the VPATH command, SOURCE_PATH command, ../test/lib
but none of these commands helped.

please help.

The answer is too complex, so I direct you to some links to help you out:

Makefiles - Recursive Make For Sub-directories

That paper uses "recursive" Makefiles, which are considered a problem by some software production teams. Here's a paper which teaches you the same thing "non-recursively"

Implementing non-recursive make

Thanks a lot Otheus. I will read it and see.