Root/
| 1 | # Iris: micro-kernel for a capability-based operating system. |
| 2 | # mips/trendtac/Makefile.arch: board-specific parts of the build rules |
| 3 | # Copyright 2009 Bas Wijnen <wijnen@debian.org> |
| 4 | # |
| 5 | # This program is free software: you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation, either version 3 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | load = 0x80000000 |
| 19 | |
| 20 | ARCH_CXXFLAGS = -DNUM_THREADS=3 -DTRENDTAC |
| 21 | ARCH_CPPFLAGS = -I. -Imips -Imips/trendtac -Wa,-mips32 |
| 22 | CROSS = mipsel-linux-gnu- |
| 23 | OBJDUMP = $(CROSS)objdump |
| 24 | junk = mdebug.abi32 reginfo comment pdr |
| 25 | OBJCOPYFLAGS = $(addprefix --remove-section=.,$(junk)) |
| 26 | |
| 27 | arch_iris_sources = mips/interrupts.cc mips/arch.cc |
| 28 | boot_sources = mips/init.cc mips/trendtac/board.cc |
| 29 | arch_headers = mips/arch.hh mips/trendtac/jz4730.hh mips/trendtac/board.hh |
| 30 | boot_threads = init gpio lcd |
| 31 | |
| 32 | uimage: |
| 33 | |
| 34 | mips/boot.o: TARGET_FLAGS = -DMEMORY_SIZE="128 << 20" |
| 35 | mips/trendtac/threadlist.o: $(addsuffix .elf,$(boot_threads)) |
| 36 | mips/init.o: TARGET_FLAGS = -I/usr/include |
| 37 | $(addsuffix .elf,$(boot_threads)): TARGET_FLAGS = -I. |
| 38 | $(addprefix boot-programs/,$(addsuffix .cc,$(boot_threads))): devices.hh |
| 39 | lcd: boot-programs/charset.data |
| 40 | |
| 41 | boot-programs/charset.data: boot-programs/charset |
| 42 | $< > $@ |
| 43 | |
| 44 | # Transform ':' into ';' so vim doesn't think there are errors. |
| 45 | uimage: iris.raw.gz Makefile mips/Makefile.arch |
| 46 | 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' |
| 47 | |
| 48 | %.o:%.S Makefile Makefile.arch mips/arch.hh |
| 49 | $(CC) $(CPPFLAGS) $(TARGET_FLAGS) -DKERNEL_STACK_SIZE=0x2000 -c $< -o $@ |
| 50 | |
| 51 | # entry.o must be the first file. threadlist.o must be the first of the init objects (which can be freed after loading). |
| 52 | iris: mips/entry.o $(subst .cc,.o,$(iris_sources)) mips/trendtac/threadlist.o mips/boot.o $(subst .cc,.o,$(boot_sources)) |
| 53 | $(LD) --omagic -Ttext $(load) $^ -o $@ |
| 54 | |
| 55 | %.raw: % |
| 56 | $(OBJCOPY) -S $(OBJCOPYFLAGS) -Obinary $< $@ |
| 57 | |
| 58 | %.gz: % |
| 59 | gzip < $< > $@ |
| 60 | |
| 61 | ARCH_CLEAN_FILES = uimage $(addsuffix .elf,$(boot_threads)) mips/*.o boot-programs/charset.data iris iris.raw iris.raw.gz |
| 62 |
Branches:
master
