Changeset 25b0e6a in mainline


Ignore:
Timestamp:
2005-11-22T15:58:55Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc6f688
Parents:
7b6c5f4
Message:

break up uspace into separate parts

Files:
2 added
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • Makefile

    r7b6c5f4 r25b0e6a  
    3434endif
    3535
    36 ## Common compiler flags
    37 #
     36SOURCES = \
     37        libc \
     38        init
    3839
    39 DEFS = -DARCH=$(ARCH)
    40 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Ilibc/include
    41 LFLAGS = -M
    42 AFLAGS =
     40CLEANS := $(addsuffix .clean,$(SOURCES))
    4341
    44 ## Setup platform configuration
    45 #
     42.PHONY: all $(SOURCES) $(CLEANS) clean
    4643
    47 include libc/arch/$(ARCH)/Makefile.inc
     44all: $(SOURCES)
    4845
    49 ## Toolchain configuration
    50 #
     46clean: $(CLEANS)
     47        find $(SOURCES) -name '*.o' -follow -exec rm \{\} \;
    5148
    52 ifeq ($(COMPILER),native)
    53         CC = gcc
    54         AS = as
    55         LD = ld
    56         OBJCOPY = objcopy
    57         OBJDUMP = objdump
    58 else
    59         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    60         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    61         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    62         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    63         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    64 endif
     49$(CLEANS):
     50        $(MAKE) -C $(basename $@) clean ARCH=$(ARCH)
    6551
    66 .PHONY: all clean
    67 
    68 all: init
    69 
    70 clean:
    71         -rm -f init init.map _link.ld *.o
    72         $(MAKE) -C libc clean ARCH=$(ARCH)
    73 
    74 libc/libc.a:
    75         $(MAKE) -C libc all ARCH=$(ARCH)
    76 
    77 _link.ld: _link.ld.in
    78         $(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
    79 
    80 init: init.o libc/libc.a _link.ld
    81         $(LD) -T _link.ld $(LFLAGS) init.o libc/libc.a -o $@ -Map init.map
    82 
    83 %.o: %.S
    84         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    85 
    86 %.o: %.s
    87         $(AS) $(AFLAGS) $< -o $@
    88 
    89 %.o: %.c
    90         $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
     52$(SOURCES):
     53        $(MAKE) -C $@ all ARCH=$(ARCH)
  • libc/Makefile

    r7b6c5f4 r25b0e6a  
    2727#
    2828
    29 ## Make some default assumptions
    30 #
    31 
    32 ifndef ARCH
    33         ARCH = ia32
    34 endif
    35 
    3629## Common compiler flags
    3730#
    3831
     32LIBC_PREFIX = .
    3933DEFS = -DARCH=$(ARCH)
    40 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Iinclude
     34CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include
    4135LFLAGS = -M
    4236AFLAGS =
    4337
    44 ## Setup platform configuration
     38## Setup toolchain
    4539#
    4640
    47 include arch/$(ARCH)/Makefile.inc
    48 
    49 ## Toolchain configuration
    50 #
    51 
    52 ifeq ($(COMPILER),native)
    53         CC = gcc
    54         AS = as
    55         LD = ld
    56         AR = ar
    57         OBJCOPY = objcopy
    58         OBJDUMP = objdump
    59 else
    60         CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
    61         AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
    62         LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
    63         AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar
    64         OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
    65         OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    66 endif
     41include $(LIBC_PREFIX)/Makefile.toolchain
    6742
    6843## Sources
     
    8156.PHONY: all clean depend
    8257
    83 all: libc.a
     58all: libc.a _link.ld
    8459
    8560-include Makefile.depend
    8661
    8762clean:
    88         -rm -f libc.a Makefile.depend
     63        -rm -f libc.a _link.ld Makefile.depend
    8964        find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \;
    9065
     
    9469libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
    9570        $(AR) rc libc.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
     71
     72_link.ld: _link.ld.in
     73        $(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
    9674
    9775%.o: %.S
  • libc/_link.ld.in

    r7b6c5f4 r25b0e6a  
    11OUTPUT_FORMAT(binary)
    2 STARTUP(libc/arch/ARCH/entry.o)
     2STARTUP(../libc/arch/ARCH/entry.o)
    33ENTRY(__entry)
    44
Note: See TracChangeset for help on using the changeset viewer.