Root/Makefile

Source at commit 12bfb32 created 13 years 10 months ago.
By Bas Wijnen, make things work with unfinished new startup procedure
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 $(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
30# Include arch-specific rules.
31include Makefile.arch
32
33# Disable implicit rules.
34%.o: %.S
35%.o: %.cc
36
37PYPP = /usr/bin/pypp
38%.cc: %.ccp
39    $(PYPP) --name $< < $< > $@
40%.hh: %.hhp
41    $(PYPP) --name $< < $< > $@
42
43%.o:%.cc Makefile Makefile.arch $(headers)
44    $(CC) $(CPPFLAGS) $(TARGET_FLAGS) $(CXXFLAGS) -c $< -o $@
45
46%.elf: boot-programs/crt0.o boot-programs/%.o
47    $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
48    $(OBJCOPY) -S $(OBJCOPYFLAGS) $@
49
50fs/%.elf: source/crt0.o source/%.o
51    $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
52    $(OBJCOPY) -S $(OBJCOPYFLAGS) $@
53
54fs/%: %
55    ln -s ../$< $@
56
57clean:
58    rm -f *.o boot-programs/*.o $(BUILT_SOURCES) $(ARCH_CLEAN_FILES)
59
60debug:
61    stty -F $(SERIAL) raw 9600
62    cat $(SERIAL)
63
64.PHONY: clean
65.PRECIOUS: iris.hh kernel.hh boot-programs/crt0.o
66

Archive Download this file

Branches:
master



interactive