2009-06-01 15:26:42 +03:00
|
|
|
# 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.
|
2009-08-24 22:02:35 +03:00
|
|
|
CXXFLAGS = -Wno-unused-parameter -fno-strict-aliasing -fno-builtin -nostdinc $(ARCH_CXXFLAGS) -ggdb3
|
2009-06-08 14:46:13 +03:00
|
|
|
CPPFLAGS = -O5 -fno-inline $(ARCH_CPPFLAGS)
|
2009-05-11 01:28:12 +03:00
|
|
|
CC = $(CROSS)gcc
|
|
|
|
LD = $(CROSS)ld
|
|
|
|
OBJCOPY = $(CROSS)objcopy
|
|
|
|
|
2009-08-18 00:11:15 +03:00
|
|
|
headers = kernel.hh iris.hh $(arch_headers)
|
2009-07-27 21:03:58 +03:00
|
|
|
iris_sources = panic.cc data.cc alloc.cc memory.cc invoke.cc schedule.cc $(arch_iris_sources)
|
|
|
|
BUILT_SOURCES = $(iris_sources) $(boot_sources)
|
2009-05-11 01:28:12 +03:00
|
|
|
|
2009-06-01 15:26:42 +03:00
|
|
|
# Include arch-specific rules.
|
|
|
|
include Makefile.arch
|
|
|
|
|
|
|
|
# Disable implicit rules.
|
|
|
|
%.o: %.S
|
|
|
|
%.o: %.cc
|
|
|
|
|
2009-05-11 01:28:12 +03:00
|
|
|
PYPP = /usr/bin/pypp
|
2009-05-25 01:31:35 +03:00
|
|
|
%.cc: %.ccp
|
2009-05-11 01:28:12 +03:00
|
|
|
$(PYPP) --name $< < $< > $@
|
2009-06-01 15:26:42 +03:00
|
|
|
%.hh: %.hhp
|
2009-05-11 01:28:12 +03:00
|
|
|
$(PYPP) --name $< < $< > $@
|
|
|
|
|
2009-06-01 15:26:42 +03:00
|
|
|
%.o:%.cc Makefile Makefile.arch $(headers)
|
|
|
|
$(CC) $(CPPFLAGS) $(TARGET_FLAGS) $(CXXFLAGS) -c $< -o $@
|
2009-05-11 01:28:12 +03:00
|
|
|
|
2009-10-31 10:32:23 +02:00
|
|
|
%.elf: boot-programs/crt0.o boot-programs/%.o
|
2009-09-27 11:23:33 +03:00
|
|
|
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
|
2009-06-10 23:54:12 +03:00
|
|
|
#$(OBJCOPY) -S $(OBJCOPYFLAGS) $@
|
2009-05-11 01:28:12 +03:00
|
|
|
|
2010-01-14 19:14:37 +02:00
|
|
|
fs/%.elf: source/crt0.o source/%.o
|
|
|
|
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@
|
|
|
|
#$(OBJCOPY) -S $(OBJCOPYFLAGS) $@
|
|
|
|
|
2009-05-11 01:28:12 +03:00
|
|
|
clean:
|
2009-07-27 21:03:58 +03:00
|
|
|
rm -f *.o boot-programs/*.o $(BUILT_SOURCES) $(ARCH_CLEAN_FILES)
|
2009-05-11 01:28:12 +03:00
|
|
|
|
2009-12-31 12:22:25 +02:00
|
|
|
debug:
|
|
|
|
stty -F /dev/ttyS0 raw 9600
|
|
|
|
cat /dev/ttyS0
|
|
|
|
|
2009-05-11 01:28:12 +03:00
|
|
|
.PHONY: clean
|
2009-12-26 15:17:06 +02:00
|
|
|
.PRECIOUS: iris.hh kernel.hh boot-programs/crt0.o
|