Assume that I had created a makefile in directory "projectX". In directory "projectX", assume that there is a subdirectory named "projectY" with a makefile inside.
I want to make the makefile in directory "projectX", when executed, it will also execute the makefile stored in "projectY" at first.
What are the codes I need to implement in makefile in directory "projectX"?
EDIT: That's not quite the example asked for. It will try to build two projects in sub directories projectX and projectY from the current project in the current directory.
In a top-level makefile, just use something like: $(MAKE) -C dir
The -C option changes the directory before invoking the make. The $(MAKE) variable will use the same make executable as the top-level makefile. man make for more information.