📄 makefile
字号:
chmod a-x $@loader-sflash-test.elf : loader-sflash-test.o $(LD) --gc-section -e stage0_start -Ttext 0x40000000 -o $@ $< $(OBJDUMP) -d -S -x $@ > loader-sflash-test.maploader-sflash-test.o : loader-sflash-test.s $(CC) $(CFLAGS) -c -o $@ $<loader-sflash-test.s : loader-stage0.S config.h $(RTCONFIG) Makefile $(CPP) $(CPPFLAGS) -DCONFIG_BOOTFROM_SFLASH -DCONFIG_PRODUCTIONTEST -DSTAGE0_TEST_IMAGE_SIZE=$(STAGE0_TEST_IMAGE_SIZE) $< > $@## extra sflash##ifeq ($(DEBUG_DRAMADJUSTMENT), y)XTRA_STAGE0_OBJS = em86xx_dram.o uart.o util.o vsprintf.o em86xxapi.o#else#XTRA_STAGE0_OBJS = em86xx_dram.o #endififeq ($(DRAMADJUSTMENT), y)loader-sflash.bin : loader-sflash-xtra0.bin loader-sflash-xtra-stage0.bin loader.bin cat loader-sflash-xtra0.bin /dev/zero | dd count=1028 bs=1 > $@ cat loader-sflash-xtra-stage0.bin /dev/zero | dd count=$(STAGE0_XTRA_IMAGE_SIZE) bs=1 >> $@ cat loader.bin >> $@loader-sflash-xtra-stage0.bin : loader-sflash-xtra-stage0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-sflash-xtra-stage0.elf : $(XTRA_STAGE0_OBJS)ifeq ($(TESTLOADERONRAM), y)ifeq ($(CACHE_USAGE_OFF), y) $(LD) --gc-section -e xtra_stage0 -Ttext 0x11700404 -o $@ $(XTRA_STAGE0_OBJS) else $(LD) --gc-section -e xtra_stage0 -Ttext 0x91700404 -o $@ $(XTRA_STAGE0_OBJS) endifelseifeq ($(CACHE_USAGE_OFF), y) $(LD) --gc-section -e xtra_stage0 -Ttext 0x40000400 -o $@ $(XTRA_STAGE0_OBJS) else $(LD) --gc-section -e xtra_stage0 -Ttext 0xC0000400 -o $@ $(XTRA_STAGE0_OBJS) endifendif $(OBJDUMP) -d -S -x $@ > loader-sflash-xtra-stage0.maploader-sflash-xtra0.bin : loader-sflash-xtra0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-sflash-xtra0.elf : loader-sflash-xtra0.o $(LD) --gc-section -e stage0_start -Ttext 0x40000000 -o $@ $< $(OBJDUMP) -d -S -x $@ > loader-sflash-xtra0.maploader-sflash-xtra0.o : loader-sflash-xtra0.s $(CC) $(CFLAGS) -c -o $@ $<loader-sflash-xtra0.s : loader-stage0.S config.h $(RTCONFIG) Makefile $(CPP) $(CPPFLAGS) -DCONFIG_BOOTFROM_SFLASH -DCONFIG_DRAMADJUSTMENT -DSTAGE0_XTRA_IMAGE_SIZE=$(STAGE0_XTRA_IMAGE_SIZE) $< > $@endif## loader-flash-secure-boot1.bin#loader-flash-secure-boot1.bin: loader-flash-stage2.bin cd $(CRYPTODIR)/scripts/ && ./gen_complete_pflash.sh $(ID) $(CURDIR)/loader-flash-stage2.bin > $(CURDIR)/$@## loader-flash-secure-boot0.bin#loader-flash-secure-boot0.bin: loader-flash-crypto.bin $(CRYPTODIR)/stage0/ucode_pflash.bin cd $(CRYPTODIR)/scripts/ && ./gen_complete_stage0.sh $(ID) p $(CURDIR)/loader-flash-crypto.bin ../stage0/ucode_pflash.bin > $(CURDIR)/$@## loader-sflash-secure-boot0.bin#loader-sflash-secure-boot0.bin: loader-sflash-crypto.bin $(CRYPTODIR)/stage0/ucode_sflash.bin cd $(CRYPTODIR)/scripts/ && ./gen_complete_stage0.sh $(ID) s $(CURDIR)/loader-sflash-crypto.bin ../stage0/ucode_sflash.bin > $(CURDIR)/$@## loader-flash-secure-kernel.bin#loader-flash-secure-kernel.bin: loader-flash0.bin cd $(CRYPTODIR)/scripts/ && ./gen_uncomplete_stage0.sh $(ID) p $(CURDIR)/loader-flash0.bin > $(CURDIR)/$@## loader-sflash-secure-kernel.bin#loader-sflash-secure-kernel.bin: loader-sflash0.bin cd $(CRYPTODIR)/scripts/ && ./gen_uncomplete_stage0.sh $(ID) s $(CURDIR)/loader-sflash0.bin > $(CURDIR)/$@## loader-flash-crypto.bin#CRYPTO_STAGE0_FLASH_OBJS = $(CRYPTODIR_STAGE0)/cryptolib_pflash.o uart.o util.o vsprintf.o em86xxapi.o board/board-init.oifeq ($(DRAMADJUSTMENT), y)loader-flash-crypto.bin : loader-flash-crypto-stage0.bin loader-flash.bin cat loader-flash.bin /dev/urandom | dd count=`printf $$[1024+$(STAGE0_XTRA_IMAGE_SIZE)]` bs=1 > $@ cat loader-flash-crypto-stage0.bin /dev/urandom | dd count=$(STAGE0_CRYPTO_IMAGE_SIZE) bs=1 >> $@elseloader-flash-crypto.bin : loader-flash-crypto-stage0.bin loader-flash.bin cat loader-flash.bin /dev/urandom | dd count=1024 bs=1 > $@ cat loader-flash-crypto-stage0.bin /dev/urandom | dd count=$(STAGE0_CRYPTO_IMAGE_SIZE) bs=1 >> $@endifloader-flash-crypto-stage0.bin : loader-flash-crypto-stage0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@ifeq ($(DRAMADJUSTMENT), y)loader-flash-crypto-stage0.elf : $(CRYPTO_STAGE0_FLASH_OBJS) $(LD) --gc-section -e crypto_stage0_start -Ttext `printf "0x%x" $$[0x46000400+$(STAGE0_XTRA_IMAGE_SIZE)]` -o $@ $(CRYPTO_STAGE0_FLASH_OBJS) $(OBJDUMP) -d -S -x $@ > loader-flash-crypto-stage0.mapelseloader-flash-crypto-stage0.elf : $(CRYPTO_STAGE0_FLASH_OBJS) $(LD) --gc-section -e crypto_stage0_start -Ttext 0x46000400 -o $@ $(CRYPTO_STAGE0_FLASH_OBJS) $(OBJDUMP) -d -S -x $@ > loader-flash-crypto-stage0.mapendif## loader-sflash-crypto.bin#CRYPTO_STAGE0_SFLASH_OBJS = $(CRYPTODIR_STAGE0)/cryptolib_sflash.o uart.o util.o vsprintf.o em86xxapi.o board/board-init.oifeq ($(DRAMADJUSTMENT), y)loader-sflash-crypto.bin : loader-sflash-crypto-stage0.bin loader-sflash.bin cat loader-sflash.bin /dev/urandom | dd count=`printf $$[1028+$(STAGE0_XTRA_IMAGE_SIZE)]` bs=1 > $@ cat loader-sflash-crypto-stage0.bin /dev/urandom | dd count=$(STAGE0_CRYPTO_IMAGE_SIZE) bs=1 >> $@elseloader-sflash-crypto.bin : loader-sflash-crypto-stage0.bin loader-sflash.bin cat loader-sflash.bin /dev/urandom | dd count=1028 bs=1 > $@ cat loader-sflash-crypto-stage0.bin /dev/urandom | dd count=$(STAGE0_CRYPTO_IMAGE_SIZE) bs=1 >> $@endifloader-sflash-crypto-stage0.bin : loader-sflash-crypto-stage0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@ifeq ($(DRAMADJUSTMENT), y)loader-sflash-crypto-stage0.elf : $(CRYPTO_STAGE0_SFLASH_OBJS) $(LD) --gc-section -e crypto_stage0_start -Ttext `printf "0x%x" $$[0x40000400+$(STAGE0_XTRA_IMAGE_SIZE)]` -o $@ $(CRYPTO_STAGE0_SFLASH_OBJS) $(OBJDUMP) -d -S -x $@ > loader-sflash-crypto-stage0.mapelseloader-sflash-crypto-stage0.elf : $(CRYPTO_STAGE0_SFLASH_OBJS) $(LD) --gc-section -e crypto_stage0_start -Ttext 0x40000400 -o $@ $(CRYPTO_STAGE0_SFLASH_OBJS) $(OBJDUMP) -d -S -x $@ > loader-sflash-crypto-stage0.mapendif## loader-flash-test.bin#loader-flash-test.bin : loader-flash-test0.bin loader-flash-test-stage0.bin loader.bin cat loader-flash-test0.bin /dev/zero | dd count=1024 bs=1 > $@ cat loader-flash-test-stage0.bin /dev/zero | dd count=$(STAGE0_TEST_IMAGE_SIZE) bs=1 >> $@ cat loader.bin >> $@loader-flash-test-stage0.bin : loader-flash-test-stage0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-flash-test-stage0.elf : $(TEST_STAGE0_OBJS) $(LD) --gc-section -e test_stage0 -Ttext 0x46000400 -o $@ $(TEST_STAGE0_OBJS) $(OBJDUMP) -d -S -x $@ > loader-flash-test-stage0.maploader-flash-test0.bin : loader-flash-test.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-flash-test.elf : loader-flash-test.o $(LD) --gc-section -e stage0_start -Ttext 0x46000000 -o $@ $< $(OBJDUMP) -d -S -x $@ > loader-flash-test.maploader-flash-test.o : loader-flash-test.s $(CC) $(CFLAGS) -c -o $@ $<loader-flash-test.s : loader-stage0.S config.h $(RTCONFIG) Makefile $(CPP) $(CPPFLAGS) -DCONFIG_BOOTFROM_FLASH -DCONFIG_PRODUCTIONTEST -DSTAGE0_TEST_IMAGE_SIZE=$(STAGE0_TEST_IMAGE_SIZE) $< > $@## extra flash#ifeq ($(DRAMADJUSTMENT), y)loader-flash.bin : loader-flash-xtra0.bin loader-flash-xtra-stage0.bin loader.bin cat loader-flash-xtra0.bin /dev/zero | dd count=1024 bs=1 > $@ cat loader-flash-xtra-stage0.bin /dev/zero | dd count=$(STAGE0_XTRA_IMAGE_SIZE) bs=1 >> $@ cat loader.bin >> $@loader-flash-xtra-stage0.bin : loader-flash-xtra-stage0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-flash-xtra-stage0.elf : $(XTRA_STAGE0_OBJS) $(LD) --gc-section -e xtra_stage0 -Ttext 0x46000400 -o $@ $(XTRA_STAGE0_OBJS) $(OBJDUMP) -d -S -x $@ > loader-flash-xtra-stage0.maploader-flash-xtra0.bin : loader-flash-xtra0.elf $(OBJCOPY) -Obinary $< $@ chmod a-x $@loader-flash-xtra0.elf : loader-flash-xtra0.o $(LD) --gc-section -e stage0_start -Ttext 0x46000000 -o $@ $< $(OBJDUMP) -d -S -x $@ > loader-flash-xtra0.maploader-flash-xtra0.o : loader-flash-xtra0.s $(CC) $(CFLAGS) -c -o $@ $<loader-flash-xtra0.s : loader-stage0.S config.h $(RTCONFIG) Makefile $(CPP) $(CPPFLAGS) -DCONFIG_BOOTFROM_FLASH -DCONFIG_DRAMADJUSTMENT -DSTAGE0_XTRA_IMAGE_SIZE=$(STAGE0_XTRA_IMAGE_SIZE) $< > $@endif## Miscellaneous#$(CRYPTODIR_STAGE1)/cryptolib.o: make -C $(CRYPTODIR_STAGE1)$(CRYPTODIR_STAGE0)/cryptolib_sflash.o: make -C $(CRYPTODIR_STAGE0) BOOTFROM=sflash$(CRYPTODIR_STAGE0)/cryptolib_pflash.o: make -C $(CRYPTODIR_STAGE0) BOOTFROM=pflashifeq ($(ENABLE_DVI), y)export CROSS=arm-elf-export RMCFLAGS += -DLLAD_DIRECT=1$(RUA_DIR)/emhwlib_hal/i2c/src/i2c_hal.o: make -C $(@D)endifcheckbin: @echo @echo "Binary information : " @echo " Code starts at address `$(NM) loader.elf | grep vectors | awk '/ / { print $$1 }'`" @echo " BSS ends at address `$(NM) loader.elf | grep __bss_end__ | awk '/ / { print $$1 }'`" @echo " Size of loader.bin : `stat --format=%s loader.bin`"ifeq ($(PRODUCTIONTEST), y) @echo " Size of stage0 test binary : `stat --format=%s loader-sflash-test-stage0.bin` (Maximum = $(STAGE0_TEST_IMAGE_SIZE))" @echo " Size of loader-sflash-test.bin : `stat --format=%s loader-sflash-test.bin`" @echo " Size of loader-flash-test.bin : `stat --format=%s loader-flash-test.bin`"elseifeq ($(DRAMADJUSTMENT), y) @echo " Size of stage0 xtra binary : `stat --format=%s loader-sflash-xtra-stage0.bin` (Maximum = $(STAGE0_XTRA_IMAGE_SIZE))" @echo " Size of loader-sflash.bin : `stat --format=%s loader-sflash.bin`" @echo " Size of loader-flash.bin : `stat --format=%s loader-flash.bin`"else @echo " Size of loader-sflash.bin : `stat --format=%s loader-sflash.bin`" @echo " Size of loader-flash.bin : `stat --format=%s loader-flash.bin`" @echo " Size of loader-sflash-min.bin : `stat --format=%s loader-sflash-min.bin`"endifendififneq ($(PRODUCTIONTEST), y)ifeq ($(ENABLE_2NDBOOT), y)ifeq ($(ENABLE_FLASH), y) @echo " Size of loader-flash-stage2.bin : `stat --format=%s loader-flash-stage2.bin`"endifendifendififeq ($(ENABLE_CRYPTO), y)ifneq ($(ENABLE_CRYPTO_FULL), y) @echo " Size of loader-sflash-secure-kernel.bin : `stat --format=%s loader-sflash-secure-kernel.bin`" @echo " Size of loader-flash-secure-kernel.bin : `stat --format=%s loader-flash-secure-kernel.bin`"endifendififeq ($(ENABLE_CRYPTO_FULL), y)ifeq ($(findstring loader-sflash-secure-boot0.bin, $(TARGET)), loader-sflash-secure-boot0.bin) @echo " Size of loader-sflash-crypto.bin : `stat --format=%s loader-sflash-crypto.bin`" @echo " Size of loader-sflash-secure-boot0.bin : `stat --format=%s loader-sflash-secure-boot0.bin`"endififeq ($(findstring loader-flash-secure-boot0.bin, $(TARGET)), loader-flash-secure-boot0.bin) @echo " Size of loader-flash-crypto.bin : `stat --format=%s loader-flash-crypto.bin`" @echo " Size of loader-flash-secure-boot0.bin : `stat --format=%s loader-flash-secure-boot0.bin`"endif @echo " Size of loader-flash-secure-boot1.bin : `stat --format=%s loader-flash-secure-boot1.bin`"endif$(OBJS-y) : config.h $(RTCONFIG) Makefile$(XTRA_STAGE0_OBJS) : config.h $(RTCONFIG) Makefiletest-stage1.o : test-stage1.c $(CC) $(CFLAGS) -c -DCONFIG_PRODUCTIONTEST -o $@ $<.PHONY : cleanclean: rm -f *~ *.o board*/*.o *.s *.bin *.bin.* *.elf *.map version.h board genchecksumifeq ($(ENABLE_CRYPTO),y) make -C $(CRYPTODIR_STAGE1) cleanendififeq ($(ENABLE_CRYPTO_FULL),y) make -C $(CRYPTODIR_STAGE0) BOOTFROM=sflash clean make -C $(CRYPTODIR_STAGE0) BOOTFROM=pflash cleanendififeq ($(ENABLE_DVI), y) make -C $(RUA_DIR)/emhwlib_hal/i2c/src/ cleanendifcleanall: clean rm -f .configifeq ($(ENABLE_CRYPTO),y) make -C $(CRYPTODIR_STAGE1) cleanallendififeq ($(ENABLE_CRYPTO_FULL),y) make -C $(CRYPTODIR_STAGE0) BOOTFROM=sflash cleanall make -C $(CRYPTODIR_STAGE0) BOOTFROM=pflash cleanallendififeq ($(ENABLE_DVI), y) make -C $(RUA_DIR)/emhwlib_hal/i2c/src/ cleanallendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -