Apollo 编译

------------------------------------------
Init:
------------------------------------------
Follow official process to source ./setup and make all

------------------------------------------
Build Env save & recover:
------------------------------------------
. In build terminal
  #sh ./build_save.sh

! build_save.sh
#!/bin/sh
env | sort |  grep -v "^_=" | grep -v "^OLDPWD=" | grep -v "^PWD=" > build_env
 
. New a terminal
  #source ./build_recover.sh
  and select "y"
 
! build_recover.sh
#!/bin/sh
env | sort > normal_env
diff build_env normal_env | grep ^\>
read CONFIRM
if [ $CONFIRM = y ]; then
diff build_env normal_env | grep ^\< | sed 's/^</export/g' > add_env
source ./add_env
fi

这样,我们甚至可以开很多terminal,都能编译项目。

------------------------------------------
KERNEL part:
------------------------------------------

### clean  => clean source code and output
make -C $(dirname $KSRC) kernel_clean

### make => unpack, patch, config, make
make -C $(dirname $KSRC) all

### change, make, install
make -C $(dirname $KSRC)
> Then the result is located in $KERNEL_OBJ_DIR
make -C $(dirname $KSRC) kernel_bin_install

### menuconfig and make
make -C $KSRC O=$KERNEL_OBJ_DIR menuconfig
> make follow previous description

### view .config
vim $KERNEL_OBJ_DIR/.config
 

------------------------------------------
uboot part:
------------------------------------------

compile and make:
#cd target/build/linux/sub-systems/bootldr
#make uboot_distclean
#make uboot_clean
#make uboot

---------------------------------------------------------------------------------------------------

为了避免每次都clean,可以在makefile加入target:

test:
        $(MAKE) -C $(_TMROOT)/sd/bootldr/comps/tmbssuboot test

而target/src//sd/bootldr/comps/tmbssuboot/makefile

test:
        @$(MAKE) -C $(UBOOT_VERSION) -j2 O=$(UBOOT_OBJ_DIR) all

        @install $(UBOOT_OBJ_DIR)/u-boot.bin /home/qianjiang/tftpboot

对于bootldr和uboot的编译都应该参考总的makefile,在编译uboot,uloader之前export了什么环境,主要是STB_SW_CONFIG,请参考:
http://jiangjqian.blog.51cto.com/1040847/402154
-----------------------------------------------------------------------------------------------------
SRC:
target/src//sd/bootldr/comps/tmbssuboot/u-boot-2009.08/

Output:
target/output/objs/summit-dualhd-gnu-4.4.0-linux-debug/u-boot-2009.08/

 

----------------------------------------------------------------

uldr

export STB_SW_CONFIG=bare_skyworth && export _TMTGTOS=nullos && export _TMTGTOSCLASS=nullos && export _TMLINKTYPE=static && ${MAKE} -C ${NXP_BASE_ROOT}/target/build/linux/sub-systems/bootldr ul

还需要patch把atag写入uboot.bin,然后pad成64k

这些配置源于应用的makefile