Root/
| 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. |
| 19 | SERIAL = /dev/ttyUSB0 |
| 20 | CXXFLAGS = -Wno-unused-parameter -fno-strict-aliasing -fno-builtin -nostdinc $(ARCH_CXXFLAGS) -ggdb3 |
| 21 | CPPFLAGS = -O5 -fno-inline $(ARCH_CPPFLAGS) |
| 22 | CC = $(CROSS)gcc |
| 23 | LD = $(CROSS)ld |
| 24 | OBJCOPY = $(CROSS)objcopy |
| 25 | |
| 26 | headers = kernel.hh iris.hh devices.hh ui.hh keys.hh $(arch_headers) |
| 27 | iris_sources = panic.cc data.cc alloc.cc memory.cc invoke.cc schedule.cc $(arch_iris_sources) |
| 28 | BUILT_SOURCES = $(iris_sources) $(boot_sources) |
| 29 | |
| 30 | STRIPFLAG = -S |
| 31 | |
| 32 | # Include arch-specific rules. |
| 33 | include Makefile.arch |
| 34 | |
| 35 | # Disable implicit rules. |
| 36 | %.o: %.S |
| 37 | %.o: %.cc |
| 38 | |
| 39 | PYPP = /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 | |
| 52 | fs/%.elf: source/crt0.o source/%.o fs/init.config |
| 53 | $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ |
| 54 | $(OBJCOPY) $(STRIPFLAG) $(OBJCOPYFLAGS) $@ |
| 55 | |
| 56 | fs/%: % |
| 57 | test -d fs || mkdir fs |
| 58 | ln -s ../$< $@ |
| 59 | |
| 60 | clean: |
| 61 | rm -f *.o boot-programs/*.o $(BUILT_SOURCES) $(ARCH_CLEAN_FILES) |
| 62 | rm -rf fs/ |
| 63 | |
| 64 | debug: |
| 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 |
Branches:
master
