1,5 → 1,6 |
# |
# Copyright (c) 2005 Martin Decky |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
39,6 → 40,7 |
include $(LIBC_PREFIX)/Makefile.toolchain |
|
CFLAGS += -I$(CONSOLE_PREFIX) |
PIC_CFLAGS := $(CFLAGS) -fPIC -D__PIC__ |
|
## Sources |
# |
84,9 → 86,12 |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
|
OBJECTS = $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
PIC_OBJECTS = $(addsuffix .pio,$(basename $(OBJECTS))) |
|
.PHONY: all clean depend kerninc |
|
all: kerninc libc.a arch/$(ARCH)/_link.ld |
all: kerninc libc.a libc.pic.a arch/$(ARCH)/_link.ld |
|
kerninc: |
ln -sfn ../../../../kernel/generic/include include/kernel |
96,15 → 101,19 |
-include Makefile.depend |
|
clean: |
-rm -f include/kernel include/arch include/libarch libc.a arch/$(ARCH)/_link.ld Makefile.depend |
find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \; |
-rm -f include/kernel include/arch include/libarch libc.a libc.pic.a arch/$(ARCH)/_link.ld Makefile.depend |
find . \( -name '*.o' -o -name '*.pio' \) -follow -exec rm \{\} \; |
|
depend: kerninc |
-makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
-makedepend $(DEFS) $(PIC_CFLAGS) -o.pio -f - $(ARCH_SOURCES) $(GENERIC_SOURCES) >> Makefile.depend 2> /dev/null |
|
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
libc.a: depend $(OBJECTS) |
$(AR) rc $@ $(LIBS) $(OBJECTS) |
|
libc.pic.a: depend $(PIC_OBJECTS) |
$(AR) rc $@ $(LIBS) $(PIC_OBJECTS) |
|
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
|
116,3 → 125,12 |
|
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
|
%.pio: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
|
%.pio: %.s |
$(AS) $(AFLAGS) $< -o $@ |
|
%.pio: %.c |
$(CC) $(DEFS) $(PIC_CFLAGS) -c $< -o $@ |