无线通信的主要编程软件,是无线通信工作人员的必备工具,关天相关教程我会在后续传上.
源代码在线查看: pxa27x.rules
#-*-Makefile-*- vim:syntax=make
#$Id: pxa27x.rules,v 1.7 2005/10/18 21:34:25 lnachman Exp $
define PXA27X_HELP
PXA27x extras:
debug : compile with minimal optimization and debug symbols
debugopt : compile with debug symbols
endef
HELP += $(PXA27X_HELP)
AS = xscale-elf-as
ASFLAGS = -mcpu=iwmmxt -mfpu=softfpa
OBJCOPY = xscale-elf-objcopy
OBJDUMP = xscale-elf-objdump
SET_ID = $(TINYOS_MAKE_PATH)/msp/set-mote-id
XDB_SYMBOL_EXTRACT = dwarf2bd
NCC = ncc
LIBS = -lm
BUILDDIR = build/$(PLATFORM)
MAIN_EXE = $(BUILDDIR)/main.exe
MAIN_BIN = $(BUILDDIR)/main.bin
INSTALL_BIN = $(MAIN_BIN).out$(if $(NODEID),-$(NODEID),)
PLATFORM_DIR = $(TOSDIR)/platform/pxa27x
ASSEMBLY_FILES += $(PLATFORM_DIR)/barecrt.s $(PLATFORM_DIR)/mmu_table.s $(PLATFORM_DIR)/util.s
ASSEMBLY_OBJS = $(BUILDDIR)/asms.o
MOTELIB = $(PLATFORM_DIR)/lib/libimote2.a
#MOTELIB = $(PLATFORM_DIR)/lib/profile.o $(PLATFORM_DIR)/lib/queue.o
OPTFLAGS ?= -O3 -g
PFLAGS += -Wall -Wshadow -DDEF_TOS_AM_GROUP=$(DEFAULT_LOCAL_GROUP) $(NESC_FLAGS)
PFLAGS += -target=$(PLATFORM) -fnesc-cfile=$(BUILDDIR)/app.c -board=$(SENSORBOARD)
ifdef MSG_SIZE
PFLAGS += -DTOSH_DATA_LENGTH=$(MSG_SIZE)
endif
INSTALL_PROGRAM ?= jtag
BUILDLESS_DEPS += bytes
#if PROGRAM is not defined, go get what we've defined as the install program
$(if $(PROGRAM),,$(call TOSMake_include,pxa27x/$(INSTALL_PROGRAM).extra))
ifndef BUILD_DEPS
ifeq ($(filter $(BUILDLESS_DEPS),$(GOALS)),)
BUILD_DEPS = bin bytes $(POST_BUILD_EXTRA_DEPS)
endif
endif
setid: FORCE
@cmd () { echo "$$@"; $$@; }; if [ x = x$(NODEID) ]; then cmd $(OBJCOPY) --output-target=binary $(MAIN_EXE) $(INSTALL_BIN); else cmd $(SET_ID) --objcopy $(OBJCOPY) --objdump $(OBJDUMP) --target binary $(MAIN_EXE) $(INSTALL_BIN) $(NODEID); fi
objcopy:
$(OBJCOPY) --output-target=binary $(MAIN_EXE) $(INSTALL_BIN)
bin: exe objcopy FORCE
$(XDB_SYMBOL_EXTRACT) $(MAIN_EXE)
exe: exe0 bytes FORCE
@:
exe0: builddir asms library $(BUILD_EXTRA_DEPS) FORCE
@echo " compiling $(COMPONENT) to a $(PLATFORM) binary"
$(NCC) -o $(MAIN_EXE) $(OPTFLAGS) $(PFLAGS) $(CFLAGS) $(COMPONENT).nc $(LIBS) $(LDFLAGS) $(ASSEMBLY_OBJS) $(MOTELIB)
@echo " compiled $(COMPONENT) to $(MAIN_EXE)"
builddir: FORCE
mkdir -p $(BUILDDIR)
bytes: FORCE
@objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{data}+$$b{bss}); }'
asms:
$(AS) $(ASFLAGS) $(ASSEMBLY_FILES) -o $(BUILDDIR)/asms.o
library:
cd $(PLATFORM_DIR)/lib; make;