📄 makefile
字号:
## Makefile (sem_create) 2004-06-07## Copyright (C) 2004 # T-Engine Application Development Centre (TEADEC)## Usage:# make # build the target# make mode=debug# build the target with debug flag (for gdb)# make clean# clean up the built objects# make install# install the target into a predefined directory# Create source file dependency (generated automatically)DEPS = DependenciesDEPENDENCIES_OUTPUT := $(DEPS)# common makefile for samplesinclude ../../etc/makerules# ----------------------------------------------------------------------------# target objectTARGET = sem_create# source file pathsS = ../srcVPATH = $S# common source filesSRC = main.cOBJ = $(addsuffix .o, $(basename $(SRC)))SRC.C = $(strip $(patsubst %.C, %.c, $(filter %.C, $(SRC))))# compiler optionsCFLAGS += $(CFLAGS_WARNING)# link libtm.a in debug modeifeq ($(mode), debug) LDLIBS += -ltmendif# linking rules for different T-Engine boardsifeq ($(MACHINE), sh7727) $(TARGET).abs: START_ADR = -Wl,-Ttext,0xc0000074 # ROM # $(TARGET).abs: START_ADR = -Wl,-Ttext,0x80400000,-Tdata,0x8d000000 # LDFLAGS3 = -static -T $(COMMONLIB)/static-rom.lnk # RAM # $(TARGET).abs: START_ADR = -Wl,-Ttext,0x8d000000,-Tdata,0x8d100000 # LDFLAGS3 = -static -T $(COMMONLIB)/static-rom.lnkendififeq ($(MACHINE), sh7751) $(TARGET).abs: START_ADR = -Wl,-Ttext,0xc0000074endififeq ($(MACHINE), s1c38k) $(TARGET).abs: START_ADR = -Wl,-Ttext,0xc0000074endififeq ($(MACHINE), mc9328) $(TARGET).abs: START_ADR = -Wl,-Ttext,0xc0000074endififneq ($(filter $(MACHINE), vr5500 vr4131 tx4956), ) $(TARGET).abs: START_ADR = -Wl,-Ttext,0xf0000074endififeq ($(MACHINE), m32104)ifeq ($(mode), debug) # RAM START_ADR = -Wl,-Ttext,0x04800000,-Tdata,0x04900000else # ROM START_ADR = -Wl,-Ttext,0x00080000,-Tdata,0x04800000endifendif# ----------------------------------------------------------------------------.PHONY: all clean installifeq ($(MACHINE), m32104) INST = $(TARGET) $(TARGET).map $(TARGET).mot %.map: %.abselse ifeq ($(mode), debug) NOINST = $(TARGET).trg endif INST = $(TARGET) $(TARGET).abs $(TARGET).map $(TARGET).mot %.map: %endifall: $(INST) $(NOINST)$(TARGET): $(OBJ) $(LINK.o) $(LDOBJS) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)$(TARGET).abs: $(OBJ) $(LINK_A.o) $(LDOBJS) $^ $(LOADLIBES) $(LDLIBS) -o _$@ $(LOCATE.o) _$@ $(OUTPUT_OPTION) $(RM) _$@$(TARGET).trg: $(TARGET).abs cp $< $@ $(STRIP) $@ifeq ($(MACHINE), m32104) $(TARGET).mot: $(TARGET) $(OBJCOPY) $(OUTPUT_SREC) $< $@else $(TARGET).mot: $(TARGET).abs $(OBJCOPY) $(OUTPUT_SREC) $< $@endifclean: $(RM) $(OBJ) $(SRC.C) $(INST) $(NOINST) $(DEPS)install: $(addprefix $(EXE_INSTALLDIR)/, $(INST))$(addprefix $(EXE_INSTALLDIR)/, $(TARGET)): $(EXE_INSTALLDIR)/%: % $(EXE_INSTALL_STRIP)# generate dependenciesifdef DEPENDENCIES_OUTPUT $(DEPS): ; touch $(DEPS)else $(DEPS): $(SRC) ; $(MAKEDEPS) $@ $?endifinclude $(DEPS)$(SRC.C):
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -