2009-03-27 20:00:10 +00:00
|
|
|
#
|
|
|
|
# (C) Copyright 2000-2004
|
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
|
|
|
# See file CREDITS for list of people who contributed to this
|
|
|
|
# project.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
# published by the Free Software Foundation; either version 2 of
|
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
# Deal with colliding definitions from tcsh etc.
|
|
|
|
VENDOR=
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
|
|
|
|
export TOPDIR
|
|
|
|
ARCH = arm
|
|
|
|
CPU = arm7tdmi-s
|
|
|
|
export ARCH CPU VENDOR
|
|
|
|
|
|
|
|
# load other configuration
|
|
|
|
include $(TOPDIR)/config.mk
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
2009-04-20 22:31:13 +00:00
|
|
|
AOBJS =
|
2009-03-29 13:28:29 +00:00
|
|
|
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
|
2009-11-04 22:30:18 +00:00
|
|
|
#TESTS = $(wildcard tests/*.c)
|
2010-02-21 15:25:22 +00:00
|
|
|
#TESTS = tests/blink-red.c #tests/nvm-read.c
|
2009-03-30 14:01:14 +00:00
|
|
|
TARGETS = $(patsubst %.c,%.o,$(TESTS))
|
2009-03-27 20:00:10 +00:00
|
|
|
|
|
|
|
# Add GCC lib
|
|
|
|
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
2009-04-15 17:40:21 +00:00
|
|
|
ALL = $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis)
|
2009-03-29 13:28:29 +00:00
|
|
|
|
2009-03-30 14:01:14 +00:00
|
|
|
.PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj)
|
2009-03-27 20:00:10 +00:00
|
|
|
|
2009-12-15 19:18:48 +00:00
|
|
|
LIBOBJS = $(patsubst %.c,%.o,$(wildcard libmc1322x/*.c))
|
|
|
|
|
2010-02-21 15:25:22 +00:00
|
|
|
include $(TOPDIR)/board/dev/Makefile
|
|
|
|
all: board
|
|
|
|
|
2009-12-15 19:18:48 +00:00
|
|
|
libmc1322x: libmc1322x.a
|
|
|
|
|
|
|
|
libmc1322x.a: $(LIBOBJS)
|
|
|
|
$(AR) r libmc1322x.a $(LIBOBJS)
|
|
|
|
|
2010-02-21 15:25:22 +00:00
|
|
|
#all: src/start.o src/isr.o $(ALL)
|
2009-03-27 20:00:10 +00:00
|
|
|
|
2009-11-04 22:30:18 +00:00
|
|
|
#tests/flasher.obj: src/maca.o src/nvm.o
|
|
|
|
#tests/nvm-read.obj: src/maca.o src/nvm.o
|
|
|
|
#tests/nvm-write.obj: src/maca.o src/nvm.o
|
|
|
|
#tests/rftest-rx.obj: src/maca.o src/nvm.o
|
|
|
|
#tests/rftest-tx.obj: src/maca.o src/nvm.o
|
|
|
|
#tests/tmr-ints.obj: src/isr.o
|
|
|
|
#tests/sleep.obj: src/isr.o src/maca.o src/nvm.o
|
2009-04-20 22:31:13 +00:00
|
|
|
|
|
|
|
NOTHUMB_CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
|
|
|
|
-D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
|
2009-11-04 22:30:18 +00:00
|
|
|
-I$(TOPDIR)/libmc1322x/include \
|
2009-04-20 22:31:13 +00:00
|
|
|
-fno-builtin -ffreestanding -nostdinc -isystem \
|
|
|
|
$(gccincdir) -pipe
|
2009-04-22 20:04:50 +00:00
|
|
|
NOTHUMB_CPPFLAGS_EXTRA = -march=armv4t -mlong-calls -mtune=arm7tdmi-s -DCONFIG_ARM -D__ARM__ -mthumb-interwork
|
2009-04-20 22:31:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
src/isr.o: src/isr.c
|
|
|
|
$(CC) $(NOTHUMB_CPPFLAGS) $(NOTHUMB_CPPFLAGS_EXTRA) -c -o $@ $<
|
2009-04-15 18:02:39 +00:00
|
|
|
|
2009-03-29 13:28:29 +00:00
|
|
|
%.srec: %.obj
|
2009-03-27 20:00:10 +00:00
|
|
|
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
|
|
|
|
2009-03-29 13:28:29 +00:00
|
|
|
%.ihex: %.obj
|
2009-03-27 20:00:10 +00:00
|
|
|
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
|
|
|
|
|
2009-03-29 13:28:29 +00:00
|
|
|
%.bin: %.obj
|
2009-03-27 20:00:10 +00:00
|
|
|
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
|
|
|
|
2009-03-29 13:28:29 +00:00
|
|
|
%.dis: %.obj
|
2009-04-20 18:15:24 +00:00
|
|
|
$(OBJDUMP) -SD $< > $@
|
2009-03-27 20:00:10 +00:00
|
|
|
|
2009-04-24 19:42:15 +00:00
|
|
|
%.obj: $(LDSCRIPT) %.o src/isr.o
|
2009-04-15 17:40:21 +00:00
|
|
|
$(LD) $(LDFLAGS) $(AOBJS) \
|
2009-03-27 20:00:10 +00:00
|
|
|
--start-group $(PLATFORM_LIBS) --end-group \
|
2009-04-15 18:02:39 +00:00
|
|
|
-Map $*.map $^ -o $@
|
2009-03-29 13:28:29 +00:00
|
|
|
|
2009-03-27 20:00:10 +00:00
|
|
|
|
2009-03-29 13:28:29 +00:00
|
|
|
%.System.map: %.obj
|
2009-03-27 20:00:10 +00:00
|
|
|
@$(NM) $< | \
|
|
|
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
2009-03-29 13:28:29 +00:00
|
|
|
sort > $*.System.map
|
2009-03-27 20:00:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
|
|
|
|
$(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
|
|
|
|
|
|
|
|
sinclude .depend
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
clean:
|
|
|
|
find . -type f \
|
|
|
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
2009-11-04 22:30:18 +00:00
|
|
|
-o -name '*.o' -o -name '*.a' -o -name '*.obj' \) -print \
|
2009-03-27 20:00:10 +00:00
|
|
|
| xargs rm -f
|
2009-11-04 22:30:18 +00:00
|
|
|
rm -f $(ALL) $(OBJS)
|
2009-03-27 20:00:10 +00:00
|
|
|
|
|
|
|
clobber: clean
|
|
|
|
find . -type f \
|
2009-03-30 14:01:14 +00:00
|
|
|
\( -name .depend -o -name '*.srec' -o -name '*.bin' -o -name '*.dis' -o -name '*.map' -o -name '*.obj' \) \
|
2009-03-27 20:00:10 +00:00
|
|
|
-print \
|
|
|
|
| xargs rm -f
|
|
|
|
rm -f $(OBJS) *.bak tags TAGS
|
|
|
|
rm -fr *.*~
|
2009-03-29 13:28:29 +00:00
|
|
|
rm -f $(ALL)
|
2009-03-27 20:00:10 +00:00
|
|
|
|
|
|
|
mrproper \
|
|
|
|
distclean: clobber
|
|
|
|
|
|
|
|
backup:
|
|
|
|
F=`basename $(TOPDIR)` ; cd .. ; \
|
|
|
|
tar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
|
|
|
|
|
|
|
|
#########################################################################
|