⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 Hermit-at-1.1.3,一款bootloader
💻
字号:
## Copyright (c) 2006 Atmark Techno, Inc.  All Rights Reserved.### Guarantee that the top-level TARGET variable, if set, is armadillo.#ifeq (, $(TARGET))	TARGET := armadillo2x0endif.PROFILE := $(PROFILE)status :=error :=## Configure settings based on the target passed from the top-level# makefile.  The PROFILE := armadillo line is just a default and can# be overridden from the command line.#NCVT = ../../../tools/ncvtcurrent-profile := $(shell $(NCVT) $(TARGET) $(.PROFILE))ifneq (,$(wildcard profile-stamp))	previous-profile := $(shell cat profile-stamp)	ifneq ($(current-profile), $(previous-profile))		error := profile-error	endifendif## Configuration for standalone, optimized ARM920T cross-compile.#BUILD_NAME := $(shell $(NCVT) -c "-" loader $(TARGET) $(.PROFILE) v$(HERMIT_VERSION))BUILD_TARGETS := $(BUILD_NAME).binCROSS := arm-linux-GCC_VER := $(shell $(CROSS)gcc -dumpversion | sed "s/\..*//")INCLUDEDIR := ../../../includeCC := $(CROSS)gccCFLAGS := -Wall -O2 -fomit-frame-pointer -I$(INCLUDEDIR) -nostdlib \	-DHERMIT_VERSION='"$(HERMIT_VERSION)"' \	-march=armv4 -mtune=arm9tdmi -staticCFLAGS += -DTARGET_STRING=\"$(TARGET)\" -DPROFILE_STRING=\"$(.PROFILE)\"## The LDSCRIPT variable can be overridden based on the target-derived# settings.#LDSCRIPT := flashOBJSECTIONS := .boot .text .data .bssOBJCOPYFLAGS := -O binary -S $(addprefix -j ,$(OBJSECTIONS))ASMS := boot.S lib1funcs.SSRCS := entry.c loader.c memmap.c linux.c board.c mmu.c medium_io.cSRCS += ../memzero.c ../medium.c ../frob.c ../setenv.c ../gunzip.cSRCS += ../flash/flash_core.c ../flash/flash_amd.cifeq ($(GCC_VER), 2)SRCS += ../flash/flash_spi_dummy.c ../flash/flash_intel_dummy.cendif## Profile Specific#ifeq (, $(.PROFILE))	CFLAGS += -DCONSOLE=0 -DRELOCATE	status := profile-detectendififeq (eth, $(.PROFILE))	SRCS += eth_ep93xx.c i2c_armadillo2x0.c tftpdl.c	SRCS += ../net/arp.c ../net/eth.c ../net/eth_util.c ../net/ip.c	SRCS += ../net/tftp.c ../net/udp.c ../net/mac.c	CFLAGS += -DCONSOLE=0 -DRELOCATE -DENABLE_ETH#	CFLAGS += -DDEBUG_ETH	status := profile-detectendififeq (ttyAM1, $(.PROFILE))	CFLAGS += -DCONSOLE=1 -DRELOCATE	status := profile-detectendififeq (notty, $(.PROFILE))	CFLAGS += -DRELOCATE	status := profile-detectendififeq (boot, $(.PROFILE))	ASMS := init.S lib1funcs.S	CFLAGS += -DCONSOLE=0 -DBOOTMODE	LDSCRIPT := bootmode	status := profile-detectendififeq (boot-eth, $(.PROFILE))	ASMS := init.S lib1funcs.S	SRCS += eth_ep93xx.c i2c_armadillo2x0.c tftpdl.c	SRCS += ../net/arp.c ../net/eth.c ../net/eth_util.c ../net/ip.c	SRCS += ../net/tftp.c ../net/udp.c ../net/mac.c	CFLAGS += -DCONSOLE=0 -DBOOTMODE -DENABLE_ETH#	CFLAGS += -DDEBUG_ETH	LDSCRIPT := bootmode	status := profile-detectendififneq (,$(PLL_HI))	.PLL_HI := $(PLL_HI)endififneq (,$(PLL_LO))	.PLL_LO := $(PLL_LO)endififeq (200,$(CLOCK))#	S*21/24*31 = 399.974400MHz	.PLL_HI := 0xa300	.PLL_LO := 0xd7endififeq (184,$(CLOCK))#	S*21/16*19 = 367.718400MHz	.PLL_HI := 0xa200	.PLL_LO := 0x4fendififneq (,$(.PLL_HI))	CFLAGS += -DPLL_HI=$(.PLL_HI)endififneq (,$(.PLL_LO))	CFLAGS += -DPLL_LO=$(.PLL_LO)endififeq (, $(error))ifeq (, $(status))	error := profile-unknownendifendifOBJS := $(SRCS:.c=.o)DEPS := $(SRCS:.c=.d)LIBS := -lgcc -ltargetall: $(error) profile-stamp $(BUILD_TARGETS)profile-error:	@echo "profile-stamp mismatch; 'make scrub' to switch profiles"	@echo "  previous PROFILE:" $(previous-profile)	@echo "   current PROFILE:" $(current-profile)	@falseprofile-unknown:	@echo "unknown PROFILE: $(.PROFILE)"	@falseprofile-stamp:	@echo "$(current-profile)" > $@# Hermit second stage loader (ELF image)$(BUILD_NAME).elf: $(ASMS) $(OBJS) ../common/libtarget.a Makefile $(BUILD_NAME).lds	$(CC) $(CFLAGS) -L. -L../common \		-Wl,-Map,$(BUILD_NAME).map \		-Wl,-T$(BUILD_NAME).lds -o $@ \		$(ASMS) $(OBJS) \		-Wl,--start-group $(LIBS) -Wl,--end-group$(BUILD_NAME).lds: $(wildcard loader.lds.*)	cp loader.lds.$(LDSCRIPT) $@%.bin: %.elf	$(CROSS)objcopy $(OBJCOPYFLAGS) $< $@# automated dependency checkingifeq (,$(filter clean scrub,$(MAKECMDGOALS)))-include $(DEPS)DEPENDS := ../../../depend.sh%.d: %.c	env CC=$(CC) $(DEPENDS) $< $@ $(CFLAGS)endif# installationPHONY: installinstall:	$(INSTALL) -m 644 -o root -g root \                $(BUILD_TARGETS) \                $(INSTALLPREFIX)/lib/hermit/# housecleaning.PHONY: cleanclean:	rm -f $(OBJS) loader-*.lds *.elf *.bin *.mapscrub: clean	rm -f profile-stamp 	rm -f *.d ../*.d ../flash/*.d ../net/*.d	rm -f *.o ../*.o ../flash/*.o ../net/*.o

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -