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

Changeset cec261e in mainline


Ignore:
Timestamp:
2010-01-16T21:45:58Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
3e30c0b
Parents:
dc9162b (diff), ccb785b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge improvement of remaining userspace makefiles.

Location:
uspace
Files:
13 deleted
15 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/Makefile.common

    rdc9162b rcec261e  
    2828#
    2929
    30 ## Setup toolchain
     30## Common rules for building apps.
    3131#
    3232
    33 include Makefile.common
    34 include $(LIBC_PREFIX)/Makefile.toolchain
    35 include arch/$(UARCH)/Makefile.inc
    36 
    37 CFLAGS += -Iinclude
    38 LINK = arch/$(UARCH)/_link.ld
    39 
    40 ## Sources
     33# Individual makefiles set:
     34#
     35#       USPACE_PREFIX   relative path to uspace/ directory
     36#       LIBS            libraries to link with (with relative path)
     37#       EXTRA_CFLAGS    additional flags to pass to C compiler
     38#       JOB             job file name (like appname.job)
     39#       OUTPUT          output binary name (like appname)
     40#       SOURCES         list of source files
    4141#
    4242
    43 GENERIC_SOURCES = \
    44         main.c \
    45         elf_load.c \
    46         interp.s
     43DEPEND = Makefile.depend
     44DEPEND_PREV = $(DEPEND).prev
    4745
    48 SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
    49 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     46LIBC_PREFIX = $(USPACE_PREFIX)/lib/libc
    5047
    51 .PHONY: all
     48JOB = $(OUTPUT).job
    5249
    53 all: $(OUTPUT) $(OUTPUT).disasm
     50OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
     51
     52-include $(USPACE_PREFIX)/../Makefile.config
     53include $(LIBC_PREFIX)/Makefile.toolchain
     54
     55CFLAGS += $(EXTRA_CFLAGS)
     56
     57.PHONY: all build clean
     58
     59all: \
     60    $(LIBC_PREFIX)/../../../version \
     61    $(LIBC_PREFIX)/../../../Makefile.config \
     62    $(LIBC_PREFIX)/../../../config.h \
     63    $(LIBC_PREFIX)/../../../config.defs \
     64    $(LIBS) \
     65    \
     66    $(OUTPUT) \
     67    $(EXTRA_OUTPUT)
     68        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     69
     70clean:
     71        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN)
     72        find . -name '*.o' -follow -exec rm \{\} \;
     73
     74build:
    5475
    5576-include $(DEPEND)
    5677
    57 $(OUTPUT).disasm: $(OUTPUT)
    58         $(OBJDUMP) -d $< > $@
     78$(OUTPUT): $(OBJECTS)
     79        $(AR) rc $@ $(OBJECTS)
    5980
    60 $(OUTPUT): $(OBJECTS) $(LIBS) $(LINK)
    61         $(LD) -T $(LINK) $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map
     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
    6286
    63 $(LINK): $(LINK).in
    64         $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
     87%.o: %.s $(DEPEND)
     88        $(AS) $(AFLAGS) $< -o $@
     89ifeq ($(PRECHECK),y)
     90        $(JOBFILE) $(JOB) $< $@ as asm $(AFLAGS)
     91endif
    6592
    6693%.o: %.c $(DEPEND)
     
    7097endif
    7198
    72 %.o: %.s $(DEPEND)
    73         $(AS) $(AFLAGS) $< -o $@
    74 ifeq ($(PRECHECK),y)
    75         $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS)
    76 endif
    77 
    78 $(DEPEND):
     99$(DEPEND): $(PRE_DEPEND)
    79100        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
    80101        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
  • uspace/lib/libblock/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBC_PREFIX)/libc.a
    3132
    32 .PHONY: all clean
     33OUTPUT = libblock.a
    3334
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     35SOURCES = \
     36        libblock.c
    3737
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBBLOCK)
    40         find . -name '*.o' -follow -exec rm \{\} \;
     38include ../Makefile.common
  • uspace/lib/libc/Makefile

    rdc9162b rcec261e  
    11#
    22# Copyright (c) 2005 Martin Decky
     3# Copyright (c) 2007 Jakub Jermar
    34# All rights reserved.
    45#
     
    2728#
    2829
    29 include Makefile.common
     30-include ../../../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 "^\#" > $@
  • uspace/lib/libc/Makefile.toolchain

    rdc9162b rcec261e  
    5959#
    6060
    61 include $(LIBC_PREFIX)/../../../Makefile.config
    62 include $(LIBC_PREFIX)/../../../config.defs
    63 include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
     61-include $(LIBC_PREFIX)/../../../Makefile.config
     62-include $(LIBC_PREFIX)/../../../config.defs
     63-include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
    6464
    6565## Simple detection of the host system
  • uspace/lib/libfs/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBC_PREFIX)/libc.a
    3132
    32 .PHONY: all clean
     33OUTPUT = libfs.a
    3334
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     35SOURCES = \
     36        libfs.c
    3737
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBFS)
    40         find . -name '*.o' -follow -exec rm \{\} \;
     38include ../Makefile.common
  • uspace/lib/libpci/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBC_PREFIX)/libc.a
    3132
    32 .PHONY: all clean
     33OUTPUT = libpci.a
    3334
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     35SOURCES = \
     36        access.c \
     37        generic.c \
     38        names.c \
     39        i386-ports.c
    3740
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBPCI)
    40         find . -name '*.o' -follow -exec rm \{\} \;
     41include ../Makefile.common
  • uspace/lib/softfloat/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBC_PREFIX)/libc.a
     32EXTRA_CFLAGS += -Iinclude -Iarch/$(UARCH)/include/
    3133
    32 .PHONY: all clean
     34OUTPUT = libsoftfloat.a
    3335
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     36SOURCES = \
     37        generic/add.c \
     38        generic/common.c \
     39        generic/comparison.c \
     40        generic/conversion.c \
     41        generic/div.c \
     42        generic/mul.c \
     43        generic/other.c \
     44        generic/softfloat.c \
     45        generic/sub.c
    3746
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBSOFTFLOAT)
    40         find . -name '*.o' -follow -exec rm \{\} \;
     47include ../Makefile.common
  • uspace/lib/softint/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBC_PREFIX)/libc.a
     32EXTRA_CFLAGS = -Iinclude
    3133
    32 .PHONY: all clean
     34OUTPUT = libsoftint.a
    3335
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     36SOURCES = \
     37        generic/division.c\
     38        generic/multiplication.c
    3739
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBSOFTINT)
    40         find . -name '*.o' -follow -exec rm \{\} \;
     40include ../Makefile.common
  • uspace/srv/loader/Makefile

    rdc9162b rcec261e  
    2828#
    2929
    30 include Makefile.common
     30-include ../../../Makefile.config
     31include arch/$(UARCH)/Makefile.inc
    3132
    32 .PHONY: all clean
     33USPACE_PREFIX = ../..
     34LIBS = $(LIBC_PREFIX)/libc.a
     35EXTRA_CFLAGS += -Iinclude
    3336
    34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
    35         -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    36         $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
     37OUTPUT = loader
    3738
    38 clean:
    39         rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm arch/*/_link.ld
    40         find . -name '*.o' -follow -exec rm \{\} \;
     39GENERIC_SOURCES = \
     40        main.c \
     41        elf_load.c \
     42        interp.s
     43
     44SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
     45OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     46
     47include ../Makefile.common
  • uspace/srv/loader/arch/amd64/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__64_BITS__
     29EXTRA_CFLAGS = -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/amd64.s
  • uspace/srv/loader/arch/arm32/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__32_BITS__
     29EXTRA_CFLAGS = -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/arm32.s
  • uspace/srv/loader/arch/ia32/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__32_BITS__
     29EXTRA_CFLAGS = -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ia32.s
  • uspace/srv/loader/arch/ia64/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__64_BITS__
     29EXTRA_CFLAGS = -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ia64.s
    3131AFLAGS += -xexplicit
  • uspace/srv/loader/arch/mips32/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__32_BITS__
     29EXTRA_CFLAGS = -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/mips32.s
  • uspace/srv/loader/arch/ppc32/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__32_BITS__
     29EXTRA_CFLAGS = -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ppc32.s
  • uspace/srv/loader/arch/sparc64/Makefile.inc

    rdc9162b rcec261e  
    2727#
    2828
    29 CFLAGS += -D__64_BITS__
     29EXTRA_CFLAGS = -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/sparc64.s
Note: See TracChangeset for help on using the changeset viewer.