Root/Makefile

1# Iris: micro-kernel for a capability-based operating system.
2# Makefile: 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# Define some variables.
19SERIAL = /dev/ttyUSB0
20CXXFLAGS = -Wno-unused-parameter -fno-strict-aliasing -fno-builtin -nostdinc $(ARCH_CXXFLAGS) -ggdb3
21CPPFLAGS = -O5 -fno-inline $(ARCH_CPPFLAGS)
22CC = $(CROSS)gcc
23LD = $(CROSS)ld
24OBJCOPY = $(CROSS)objcopy
25
26headers = kernel.hh iris.hh devices.hh ui.hh keys.hh $(arch_headers)
27iris_sources = panic.cc data.cc alloc.cc memory.cc invoke.cc schedule.cc $(arch_iris_sources)
28BUILT_SOURCES = $(iris_sources) $(boot_sources)
29
30STRIPFLAG = -S
31
32# Include arch-specific rules.
33include Makefile.arch
34
35# Disable implicit rules.
36%.o: %.S
37%.o: %.cc
38
39PYPP = /usr/bin/pypp
40%.cc: %.ccp
41    $(PYPP) --name $< < $< > $@
42%.hh: %.hhp
43    $(PYPP) --name $< < $< > $@
44
45%.o:%.cc Makefile Makefile.arch $(headers)
46    $(CC) $(CPPFLAGS) $(TARGET_FLAGS) $(CXXFLAGS) -c $< -o $@
47
48%.elf: boot-programs/crt0.o boot-programs/%.o
49    $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
50    $(OBJCOPY) $(STRIPFLAG) $(OBJCOPYFLAGS) $@
51
52fs/%.elf: source/crt0.o source/%.o fs/init.config
53    $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
54    $(OBJCOPY) $(STRIPFLAG) $(OBJCOPYFLAGS) $@
55
56fs/%: %
57    test -d fs || mkdir fs
58    ln -s ../$< $@
59
60clean:
61    rm -f *.o boot-programs/*.o $(BUILT_SOURCES) $(ARCH_CLEAN_FILES)
62    rm -rf fs/
63
64debug:
65    stty -F $(SERIAL) raw 57600
66    while : ; do cat $(SERIAL) ; done
67
68.PHONY: clean
69.PRECIOUS: $(headers) boot-programs/crt0.o source/crt0.o
70

Archive Download this file

Branches:
master



interactive