Changeset 1ea99cc in mainline for uspace/lib/libc/Makefile


Ignore:
Timestamp:
2009-08-20T20:47:35Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b50b5af2
Parents:
24edc18
Message:

Merge changes from original Subversion dynload branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/Makefile

    r24edc18 r1ea99cc  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2008 Jiri Svoboda
    34# All rights reserved.
    45#
     
    3839
    3940include $(LIBC_PREFIX)/Makefile.toolchain
     41-include rtld/arch/$(UARCH)/Makefile.inc
    4042
     43CFLAGS += -Irtld/include -I../../srv/loader/include -D__32_BITS__
     44PIC_CFLAGS := $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__
    4145
    4246## Sources
     
    7478        generic/ipc.c \
    7579        generic/async.c \
     80        generic/dlfcn.c \
    7681        generic/loader.c \
    7782        generic/getopt.c \
     
    8489        generic/udebug.c \
    8590        generic/vfs/vfs.c \
    86         generic/vfs/canonify.c
     91        generic/vfs/canonify.c \
     92        rtld/rtld.c \
     93        rtld/elf_load.c \
     94        rtld/dynamic.c \
     95        rtld/module.c \
     96        rtld/symbol.c
     97
    8798
    8899ARCH_SOURCES += \
     
    93104ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
    94105OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS)
     106PIC_OBJECTS := $(addsuffix .pio,$(basename $(OBJECTS)))
     107
     108OUTPUT := libc.a
     109
     110ifeq ($(CONFIG_BUILD_SHARED_LIBC), y)
     111        OUTPUT += libc.pic.a
     112endif
    95113
    96114.PHONY: all clean depend kerninc
    97115
    98 all: kerninc libc.a arch/$(UARCH)/_link.ld
     116all: kerninc $(OUTPUT) arch/$(UARCH)/_link.ld
    99117
    100118kerninc:
     
    102120        ln -sfn kernel/arch include/arch
    103121        ln -sfn ../arch/$(UARCH)/include include/libarch
     122        ln -sfn ../arch/$(UARCH)/include rtld/include/arch
    104123
    105124-include Makefile.depend
    106125
    107126clean:
    108         -rm -f include/kernel include/arch include/libarch libc.a arch/$(UARCH)/_link.ld Makefile.depend
    109         find generic/ arch/$(UARCH)/ -name '*.o' -follow -exec rm \{\} \;
     127        -rm -f include/kernel include/arch include/libarch rtld/include/arch libc.a libc.pic.a arch/$(UARCH)/_link.ld Makefile.depend
     128        find . \( -name '*.o' -o -name '*.pio' \) -follow -exec rm \{\} \;
    110129
    111130depend: kerninc
    112131        -makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
     132        -makedepend $(DEFS) $(PIC_CFLAGS) -o.pio -f - $(ARCH_SOURCES) $(GENERIC_SOURCES) >> Makefile.depend 2> /dev/null
    113133
    114 libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
    115         $(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
     134libc.a: depend $(OBJECTS)
     135        $(AR) rc $@ $(LIBS) $(OBJECTS)
     136
     137libc.pic.a: depend $(PIC_OBJECTS)
     138        $(AR) rc $@ $(LIBS) $(PIC_OBJECTS)
    116139
    117140arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
     
    126149%.o: %.c
    127150        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     151
     152%.pio: %.S
     153        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
     154
     155%.pio: %.s
     156        $(AS) $(AFLAGS) $< -o $@
     157
     158%.pio: %.c
     159        $(CC) $(DEFS) $(PIC_CFLAGS) -c $< -o $@
Note: See TracChangeset for help on using the changeset viewer.