📄 makefile
字号:
## Copyright (c) 2000 Blue Mug, Inc. All Rights Reserved.### Guarantee that the top-level TARGET variable, if set, is ep7211.#ifeq (,$(TARGET)) TARGET := ep7211endififneq (ep7211,$(TARGET)) error "building for ep7211 but TARGET != ep7211"endif## Configure settings based on the target passed from the top-level# makefile. The PROFILE := edb7211 line is just a default and can# be overridden from the command line.#PROFILE := edb7211ifneq (,$(wildcard profile-stamp)) last-profile := $(shell cat profile-stamp) ifneq ($(PROFILE),$(last-profile)) error := profile-error endifendififeq ($(PROFILE),edb7211) SETTINGS := keyboard lcd relocateendififeq ($(PROFILE),edb7211-boot) SETTINGS := bootmode keyboard standaloneendififeq ($(PROFILE),edb7211-kernel) SETTINGS := kernel keyboard life lcd standaloneendif## Configuration for standalone, optimized ARM7TDMI cross-compile.#CROSS := arm-linux-CC := $(CROSS)gccCFLAGS := -Wall -O2 -fomit-frame-pointer -I../../../include -nostdlib \ -mcpu=arm7tdmi -static## The LDSCRIPT variable can be overridden based on the target-derived# settings.#LDSCRIPT := flashOBJSECTIONS := .boot .text .data .bss .splashOBJCOPYFLAGS := -O binary -S $(addprefix -j ,$(OBJSECTIONS))ASMS := boot.SSRCS := entry.c eth.c flash_intel.c frob.c gunzip.c \ linux.c loader.c medium.c memmap.c memzero.csetp = $(if $(findstring $(1),$(SETTINGS)),y)ifeq (y,$(call setp,bootmode)) ASMS := init.S CFLAGS += -DBOOTMODE LDSCRIPT := bootmodeendififeq (y,$(call setp,kernel)) ASMS := init.S LDSCRIPT := kernelendififeq (y,$(call setp,keyboard)) CFLAGS += -DHAVE_KEYBOARD SRCS += keyboard.cendififeq (y,$(call setp,lcd)) CFLAGS += -DHAVE_LCD SRCS += lcd.c logo.cendififeq (y,$(call setp,life)) CFLAGS += -DHAVE_LIFE SRCS += life.cendififeq (y,$(call setp,relocate)) CFLAGS += -DRELOCATEendififeq (y,$(call setp,standalone)) CFLAGS += -DSTANDALONEendifOBJS := $(SRCS:.c=.o)DEPS := $(SRCS:.c=.d)LIBS := -lgcc -ltargetall: $(error) profile-stamp loader-$(PROFILE).binprofile-error: @echo "previous PROFILE:" `cat profile-stamp` @echo "profile-stamp mismatch; 'make scrub' to switch profiles"; falseprofile-stamp: echo $(PROFILE) > $@# can be invoked from top-level Makefiledownload: shoehorn --terminal# Hermit second stage loader (ELF image)loader-$(PROFILE).elf: $(ASMS) $(OBJS) ../common/libtarget.a Makefile loader-$(PROFILE).lds $(CC) $(CFLAGS) -L. -L../common \ -Wl,-Map,loader-$(PROFILE).map \ -Wl,-Tloader-$(PROFILE).lds -o $@ \ $(ASMS) $(OBJS) \ -Wl,--start-group $(LIBS) -Wl,--end-grouploader-$(PROFILE).lds: $(wildcard loader.lds.*) cp loader.lds.$(LDSCRIPT) $@%.bin: %.elf $(CROSS)objcopy $(OBJCOPYFLAGS) $< $@.SECONDARY: logo.c%.c: %.ppm.gz ppm2raw raw2splash zcat $< | ./ppm2raw | gzip | ./raw2splash > $@# 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 loader-$(PROFILE).bin \ $(INSTALLPREFIX)/lib/hermit/# housecleaning.PHONY: cleanclean: rm -f $(OBJS) loader-*.lds *.elf *.bin *.mapscrub: clean rm -f logo.c profile-stamp *.d
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -