Make Assignment
Make Assignment
1. Generate make file for template-example-1. Its output (*.o) files must be stored in subdirectory.
Define clean macro to clean the output file and directory.
2. While calling make, pass an argument USE_C with value 1 (“make USE_C=1”)
Test this variable using ifeq in your makefile.
Use c compiler or java compiler accordingly, to build the targets, depending on the condition
being true or false respectively.
Hint: Use template-example-1
3. The process in which a makefile calls other makefiles is called a recursive make. You are given
a parent folder with subdirectort, each containing base source C files You have to design a
makefile in the parent directory that recursively calls the individual makefiles of the
subdirectory. The makefiles in the subdirectories compile their respective code files and store
the output there only.
Hint: Use temple-example-2
4. Enhance the Q.No. 2 by adding Q.No.1 template-example-1 in subdirectory. You have to
design a makefile in the parent directory that recursively calls the individual makefiles of the
subdirectory. Use macros to decide C and C++ compiler.
Hint: Use temple-example-1 and temple-example-2