1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-11-16 21:36:14 +02:00
iris/Makefile
2010-05-10 01:07:17 +02:00

66 lines
1.9 KiB
Makefile

# Iris: micro-kernel for a capability-based operating system.
# Makefile: 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/>.
# Define some variables.
SERIAL = /dev/ttyUSB0
CXXFLAGS = -Wno-unused-parameter -fno-strict-aliasing -fno-builtin -nostdinc $(ARCH_CXXFLAGS) -ggdb3
CPPFLAGS = -O5 -fno-inline $(ARCH_CPPFLAGS)
CC = $(CROSS)gcc
LD = $(CROSS)ld
OBJCOPY = $(CROSS)objcopy
headers = kernel.hh iris.hh ui.hh $(arch_headers)
iris_sources = panic.cc data.cc alloc.cc memory.cc invoke.cc schedule.cc $(arch_iris_sources)
BUILT_SOURCES = $(iris_sources) $(boot_sources)
# Include arch-specific rules.
include Makefile.arch
# Disable implicit rules.
%.o: %.S
%.o: %.cc
PYPP = /usr/bin/pypp
%.cc: %.ccp
$(PYPP) --name $< < $< > $@
%.hh: %.hhp
$(PYPP) --name $< < $< > $@
%.o:%.cc Makefile Makefile.arch $(headers)
$(CC) $(CPPFLAGS) $(TARGET_FLAGS) $(CXXFLAGS) -c $< -o $@
%.elf: boot-programs/crt0.o boot-programs/%.o
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
$(OBJCOPY) -S $(OBJCOPYFLAGS) $@
fs/%.elf: source/crt0.o source/%.o
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
$(OBJCOPY) -S $(OBJCOPYFLAGS) $@
fs/%: %
ln -s ../$< $@
clean:
rm -f *.o boot-programs/*.o $(BUILT_SOURCES) $(ARCH_CLEAN_FILES)
debug:
stty -F $(SERIAL) raw 9600
cat $(SERIAL)
.PHONY: clean
.PRECIOUS: iris.hh kernel.hh ui.hh boot-programs/crt0.o