1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-11-16 21:36:14 +02:00
iris/mips/trendtac/Makefile.arch
2009-10-31 09:32:23 +01:00

62 lines
2.5 KiB
Makefile

# Iris: micro-kernel for a capability-based operating system.
# mips/trendtac/Makefile.arch: board-specific parts of the build rules
# Copyright 2009 Bas Wijnen <wijnen@debian.org>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
load = 0x80000000
ARCH_CXXFLAGS = -DNUM_THREADS=3 -DTRENDTAC
ARCH_CPPFLAGS = -I. -Imips -Imips/trendtac -Wa,-mips32
CROSS = mipsel-linux-gnu-
OBJDUMP = $(CROSS)objdump
junk = mdebug.abi32 reginfo comment pdr
OBJCOPYFLAGS = $(addprefix --remove-section=.,$(junk))
arch_iris_sources = mips/interrupts.cc mips/arch.cc
boot_sources = mips/init.cc mips/trendtac/board.cc
arch_headers = mips/arch.hh mips/trendtac/jz4730.hh mips/trendtac/board.hh
boot_threads = init gpio lcd
uimage:
mips/boot.o: TARGET_FLAGS = -DMEMORY_SIZE="128 << 20"
mips/trendtac/threadlist.o: $(addsuffix .elf,$(boot_threads))
mips/init.o: TARGET_FLAGS = -I/usr/include
$(addsuffix .elf,$(boot_threads)): TARGET_FLAGS = -I.
$(addprefix boot-programs/,$(addsuffix .cc,$(boot_threads))): devices.hh
lcd: boot-programs/charset.data
boot-programs/charset.data: boot-programs/charset
$< > $@
# Transform ':' into ';' so vim doesn't think there are errors.
uimage: iris.raw.gz Makefile mips/Makefile.arch
mkimage -A MIPS -O Linux -C gzip -a $(load) -e 0xa$(shell /bin/sh -c '$(OBJDUMP) -t iris | grep __start$$ | cut -b2-8') -n "Iris" -d $< $@ | sed -e 's/:/;/g'
%.o:%.S Makefile Makefile.arch mips/arch.hh
$(CC) $(CPPFLAGS) $(TARGET_FLAGS) -DKERNEL_STACK_SIZE=0x2000 -c $< -o $@
# entry.o must be the first file. threadlist.o must be the first of the init objects (which can be freed after loading).
iris: mips/entry.o $(subst .cc,.o,$(iris_sources)) mips/trendtac/threadlist.o mips/boot.o $(subst .cc,.o,$(boot_sources))
$(LD) --omagic -Ttext $(load) $^ -o $@
%.raw: %
$(OBJCOPY) -S $(OBJCOPYFLAGS) -Obinary $< $@
%.gz: %
gzip < $< > $@
ARCH_CLEAN_FILES = uimage $(addsuffix .elf,$(boot_threads)) mips/*.o boot-programs/charset.data iris iris.raw iris.raw.gz