Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 079f440 in mainline


Ignore:
Timestamp:
2010-01-16T20:59:55Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
94790d01
Parents:
cf240cb
Message:

Also use common make rules for libc.

Location:
uspace/lib
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/Makefile.common

    rcf240cb r079f440  
    4848JOB = $(OUTPUT).job
    4949
    50 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     50OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
    5151
     52-include $(USPACE_PREFIX)/../Makefile.config
    5253include $(LIBC_PREFIX)/Makefile.toolchain
    5354
     
    6364    $(LIBS) \
    6465    \
    65     $(OUTPUT)
     66    $(OUTPUT) \
     67    $(EXTRA_OUTPUT)
    6668        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    6769
    6870clean:
    69         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT)
     71        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN)
    7072        find . -name '*.o' -follow -exec rm \{\} \;
    7173
     
    7779        $(AR) rc $@ $(OBJECTS)
    7880
     81%.o: %.S $(DEPEND)
     82        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
     83ifeq ($(PRECHECK),y)
     84        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__
     85endif
     86
     87%.o: %.s $(DEPEND)
     88        $(AS) $(AFLAGS) $< -o $@
     89ifeq ($(PRECHECK),y)
     90        $(JOBFILE) $(JOB) $< $@ as asm $(AFLAGS)
     91endif
     92
    7993%.o: %.c $(DEPEND)
    8094        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     
    8397endif
    8498
    85 $(DEPEND):
     99$(DEPEND): $(PRE_DEPEND)
    86100        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
    87101        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
  • uspace/lib/libc/Makefile

    rcf240cb r079f440  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 include Makefile.common
     30include ../../../Makefile.config
    3031
    31 .PHONY: all clean
     32USPACE_PREFIX = $(shell pwd)/../..
     33#LIBS = $(LIBC_PREFIX)/libc.a
     34LIBS =
    3235
    33 all: ../../../Makefile.config ../../../config.h ../../../config.defs
    34         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    35         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     36LINK = arch/$(UARCH)/_link.ld
    3637
    37 clean:
    38         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LIBC) arch/*/_link.ld
    39         find generic/ arch/*/ -name '*.o' -follow -exec rm \{\} \;
     38PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
     39EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
     40EXTRA_OUTPUT = $(LINK)
     41
     42INCLUDE_KERNEL = include/kernel
     43INCLUDE_ARCH = include/arch
     44INCLUDE_LIBARCH = include/libarch
     45
     46OUTPUT = libc.a
     47
     48GENERIC_SOURCES = \
     49        generic/libc.c \
     50        generic/ddi.c \
     51        generic/as.c \
     52        generic/cap.c \
     53        generic/clipboard.c \
     54        generic/devmap.c \
     55        generic/event.c \
     56        generic/errno.c \
     57        generic/mem.c \
     58        generic/string.c \
     59        generic/fibril.c \
     60        generic/fibril_synch.c \
     61        generic/pcb.c \
     62        generic/smc.c \
     63        generic/thread.c \
     64        generic/tls.c \
     65        generic/task.c \
     66        generic/futex.c \
     67        generic/io/asprintf.c \
     68        generic/io/io.c \
     69        generic/io/printf.c \
     70        generic/io/klog.c \
     71        generic/io/snprintf.c \
     72        generic/io/vprintf.c \
     73        generic/io/vsnprintf.c \
     74        generic/io/printf_core.c \
     75        generic/io/console.c \
     76        generic/malloc.c \
     77        generic/sysinfo.c \
     78        generic/ipc.c \
     79        generic/async.c \
     80        generic/loader.c \
     81        generic/getopt.c \
     82        generic/adt/list.o \
     83        generic/adt/hash_table.o \
     84        generic/time.c \
     85        generic/err.c \
     86        generic/stdlib.c \
     87        generic/mman.c \
     88        generic/udebug.c \
     89        generic/vfs/vfs.c \
     90        generic/vfs/canonify.c \
     91        generic/stacktrace.c
     92
     93ARCH_SOURCES = \
     94        arch/$(UARCH)/src/entry.s \
     95        arch/$(UARCH)/src/thread_entry.s
     96
     97SOURCES = \
     98        $(GENERIC_SOURCES) \
     99        $(ARCH_SOURCES)
     100
     101include ../Makefile.common
     102
     103$(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
     104        ln -sfn kernel/arch $@
     105
     106$(INCLUDE_LIBARCH): arch/$(UARCH)/include
     107        ln -sfn ../$< $@
     108
     109$(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
     110
     111$(INCLUDE_KERNEL): ../../../kernel/generic/include/
     112        ln -sfn ../$< $@
     113
     114$(LINK): $(LINK).in
     115        $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
Note: See TracChangeset for help on using the changeset viewer.