# Copyright (C) OCERA Consortium. # Author: Pau Mendoza & Josep Vidal & Ismael Ripoll ######################## Variables to customise. # Name of the component COMPONENT=rtlcbs # Directory where the kernels are located KERNELS= RTLINUX = $(KERNELS)/rtlinux-3.2-pre1 LINUX = /Your__Linux_src_Directory all: install iskernelset: @if test ! -d $(RTLINUX) ; then \ echo ""; \ echo "RTLINUX Makefile variable not set."; \ echo "It must point to the directory where RTLinux code is located.";\ echo "Please, edit the Makefile and set RTLINUX variable.";\ echo "";\ Error;\ fi; $(err) @if test ! -d $(LINUX) ; then \ echo "";\ echo "LINUX Makefile variable not set." ; \ echo "It must point to the directory where Linux code is located.";\ echo "Please, edit the Makefile and set LINUX variable.";\ echo "";\ Error;\ fi; @if test ! -r $(PWD)/patches/linux-2.4.18_rtlcbs-0.1.patch; then \ echo "Linux patch file not found";\ Error;\ fi; @if test ! -r $(PWD)/patches/rtlinux-3.2pre1_rtledf-1.0.patch; then \ echo "rtledf patch file not found";\ Error;\ fi; @if test ! -r $(PWD)/patches/rtlinux-3.2pre1_rtlcbs-0.1.patch; then \ echo "rtlcbs patch file not found";\ Error;\ fi install: install_src iskernelset install_examples install_doc install_src: @if test -r $(PWD)/patches/linux-2.4.18_rtlcbs-0.1.patch -a \ -r $(PWD)/patches/rtlinux-3.2pre1_rtledf-1.0.patch -a \ -r $(PWD)/patches/rtlinux-3.2pre1_rtlcbs-0.1.patch;\ then \ echo "Patching Linux"; \ cd $(LINUX); patch -p1 < $(PWD)/patches/linux-2.4.18_rtlcbs-0.1.patch; cd -; \ if test -r $(PWD)/patches/rtlinux-3.2pre1_rtledf-1.0.patch ; then \ grep CONFIG_RTL_EDF $(RTLINUX)/schedulers/rtl_sched.c > /dev/null || \ (echo "Patching RT-Linux with EDF"; \ cd $(RTLINUX); patch -p1 < $(PWD)/patches/rtlinux-3.2pre1_rtledf-1.0.patch; cd -); \ fi;\ echo "Patching RT-Linux with CBS2"; \ cd $(RTLINUX); patch -p1 < $(PWD)/patches/rtlinux-3.2pre1_rtlcbs-0.1.patch; cd -; \ else \ echo "Patches not found"; \ Error;\ fi install_examples: iskernelset @echo "Copying examples & tests" @cp -fr examples/* $(RTLINUX)/examples/$(COMPONENT)/ install_doc: iskernelset @echo "Installing doc" @mkdir -p $(RTLINUX)/doc/$(COMPONENT) @mkdir -p $(RTLINUX)/doc/html/MAN/ @mkdir -p $(RTLINUX)/doc/man/man3/ for file in `(cd ./doc/man/; ls *.sgml)`; do \ TARGET=` echo $$file | awk -F \. '{ print $$1 }'`; \ echo "source: "$(PWD)/doc/man/$$file "dest: " $(RTLINUX)/doc/html/MAN/$$TARGET".3.html" ; \ docbook2html $(PWD)/doc/man/$$file 2> /dev/null ; \ mv $(PWD)/index.html $(RTLINUX)/doc/html/MAN/$$TARGET".3.html" ; \ done echo "Installing man pages in "$(RTLINUX) for i in 3; do mkdir -p ./doc/man/man$$i ; done for i in ./doc/man/man3/*.3; do cp $$i $(RTLINUX)/doc/man/man3 ; done @echo "Installing pdf" docbook2pdf $(PWD)/doc/$(COMPONENT)-info.xml mv $(PWD)/doc/$(COMPONENT)-info.pdf $(RTLINUX)/doc/$(COMPONENT)/ clean: iskernelset rm -f *~ *.bak