Changeset 25b0e6a in mainline
- Timestamp:
- 2005-11-22T15:58:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc6f688
- Parents:
- 7b6c5f4
- Files:
-
- 2 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r7b6c5f4 r25b0e6a 34 34 endif 35 35 36 ## Common compiler flags 37 # 36 SOURCES = \ 37 libc \ 38 init 38 39 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 = 40 CLEANS := $(addsuffix .clean,$(SOURCES)) 43 41 44 ## Setup platform configuration 45 # 42 .PHONY: all $(SOURCES) $(CLEANS) clean 46 43 47 include libc/arch/$(ARCH)/Makefile.inc 44 all: $(SOURCES) 48 45 49 ## Toolchain configuration 50 # 46 clean: $(CLEANS) 47 find $(SOURCES) -name '*.o' -follow -exec rm \{\} \; 51 48 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) 65 51 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 27 27 # 28 28 29 ## Make some default assumptions30 #31 32 ifndef ARCH33 ARCH = ia3234 endif35 36 29 ## Common compiler flags 37 30 # 38 31 32 LIBC_PREFIX = . 39 33 DEFS = -DARCH=$(ARCH) 40 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I include34 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include 41 35 LFLAGS = -M 42 36 AFLAGS = 43 37 44 ## Setup platform configuration38 ## Setup toolchain 45 39 # 46 40 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 41 include $(LIBC_PREFIX)/Makefile.toolchain 67 42 68 43 ## Sources … … 81 56 .PHONY: all clean depend 82 57 83 all: libc.a 58 all: libc.a _link.ld 84 59 85 60 -include Makefile.depend 86 61 87 62 clean: 88 -rm -f libc.a Makefile.depend63 -rm -f libc.a _link.ld Makefile.depend 89 64 find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \; 90 65 … … 94 69 libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) 95 70 $(AR) rc libc.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS) 71 72 _link.ld: _link.ld.in 73 $(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@ 96 74 97 75 %.o: %.S -
libc/_link.ld.in
r7b6c5f4 r25b0e6a 1 1 OUTPUT_FORMAT(binary) 2 STARTUP( libc/arch/ARCH/entry.o)2 STARTUP(../libc/arch/ARCH/entry.o) 3 3 ENTRY(__entry) 4 4
Note:
See TracChangeset
for help on using the changeset viewer.