Create a Makefile.src, containing the following information, in your MYCOMP directory.
all:: MYCOMP.all MYCOMP.all:: NUCLEUS.all OS.all MYCOMP.all:: $(MYCOMP_DIR)/DONE $(MYCOMP_DIR)/DONE: rm -rf $(MYCOMP_DIR) $(DEVTOOLS_DIR)/host/bin/mkmerge -s $(MYCOMP) -t $(MYCOMP_DIR) cd $(MYCOMP_DIR); $(DEVTOOLS_DIR)/host/bin/mkmk -t $(NUCLEUS_DIR) cd $(MYCOMP_DIR); $(make) touch $(MYCOMP_DIR)/DONE
This file is more complex than the Makefile.bin file as it describes how to build the component. The first lines of output give the list of components that must be built before the MYCOMP component. As the application that you are building needs operating system services, you must build the NUCLEUS and OS components before building the MYCOMP component.
The other lines in the Makefile.src file explain the following phases of the build of an mkmk component:
Creation of the merged tree with mkmerge. The MYCOMP variable points to the source directory of the component, and MYCOMP_DIR points to the component's build directory. Both variables are provided by the Paths file. This file is located at the top of the working directory and is initialized by the configure command.
Creation of the Makefiles file with mkmk.
Running of the make command in the merged tree. It is important to use $(make) instead of $(MAKE), as the make -n option executes lines containing $(MAKE) instead of displaying the file.
Declaration that the component compilation is complete.