1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-29 18:07:31 +02:00

[inflash] switch all makefiles to CROSS_COMPILE

This commit is contained in:
lindnermarek 2009-06-05 12:33:08 +00:00
parent 75b743b89f
commit 17ac04f284
3 changed files with 23 additions and 12 deletions

View File

@ -32,17 +32,22 @@ endif
STAGE1_PATH = ./device_stage1 STAGE1_PATH = ./device_stage1
STAGE2_PATH = ./device_stage2 STAGE2_PATH = ./device_stage2
CROSS_COMPILE ?= mipsel-linux-
CC = gcc CC = gcc
CFLAGS += -pedantic -Wall -W -O1 -g3 -std=gnu99 CFLAGS += -pedantic -Wall -W -O1 -g3 -std=gnu99
LDFLAGS += -lusb -lconfuse LDFLAGS += -lusb -lconfuse
BINARY_NAME = inflash BINARY_NAME = inflash
TARGETS = $(BINARY_NAME) stage1 stage2
SRC_C= main.c ingenic_cfg.c ingenic_usb.c cmd.c command_line.c SRC_C= main.c ingenic_cfg.c ingenic_usb.c cmd.c command_line.c
SRC_H= ingenic_cfg.h ingenic_usb.h usb_boot_defines.h \ SRC_H= ingenic_cfg.h ingenic_usb.h usb_boot_defines.h \
command_line.h cmd.h config.h command_line.h cmd.h config.h
SRC_O= $(SRC_C:.c=.o) SRC_O= $(SRC_C:.c=.o)
$(BINARY_NAME): $(SRC_O) $(SRC_H) Makefile stage1 stage2 default: $(TARGETS)
$(BINARY_NAME): $(SRC_O) $(SRC_H) Makefile
$(Q_LD)$(CC) -o $@ $(SRC_O) $(LDFLAGS) $(Q_LD)$(CC) -o $@ $(SRC_O) $(LDFLAGS)
.c.o: .c.o:
@ -51,13 +56,13 @@ $(BINARY_NAME): $(SRC_O) $(SRC_H) Makefile stage1 stage2
# for the device stage # for the device stage
stage1: stage1:
make -C $(STAGE1_PATH) make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
stage2: stage2:
make -C $(STAGE2_PATH) make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
clean: clean:
make clean -C $(STAGE1_PATH) make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH) clean
make clean -C $(STAGE2_PATH) make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH) clean
rm -f $(BINARY_NAME) *.o *~ rm -f $(BINARY_NAME) *.o *~
rm -f `find . -name '*.d' -print` rm -f `find . -name '*.d' -print`

View File

@ -20,7 +20,9 @@
FLASH_TOOL_PATH = .. FLASH_TOOL_PATH = ..
CROSS_COMPILE ?= mipsel-linux- ifeq ($(CROSS_COMPILE),)
$(error CROSS_COMPILE variable not set)
endif
CFLAGS := -O2 -mips32 -fno-pic -mno-abicalls -I.. CFLAGS := -O2 -mips32 -fno-pic -mno-abicalls -I..
LDFLAGS := -nostdlib -EL -T target.ld LDFLAGS := -nostdlib -EL -T target.ld

View File

@ -9,12 +9,16 @@
FLASH_TOOL_PATH = .. FLASH_TOOL_PATH = ..
CC := mipsel-linux-gcc ifeq ($(CROSS_COMPILE),)
AR := mipsel-linux-ar rcsv $(error CROSS_COMPILE variable not set)
LD := mipsel-linux-ld endif
OBJCOPY := mipsel-linux-objcopy
NM := mipsel-linux-nm CC := $(CROSS_COMPILE)gcc
OBJDUMP := mipsel-linux-objdump AR := $(CROSS_COMPILE)ar rcsv
LD := $(CROSS_COMPILE)ld
OBJCOPY := $(CROSS_COMPILE)objcopy
NM := $(CROSS_COMPILE)nm
OBJDUMP := $(CROSS_COMPILE)objdump
CFLAGS := -mips32 -O2 -FPIC \ CFLAGS := -mips32 -O2 -FPIC \
-fno-exceptions -ffunction-sections \ -fno-exceptions -ffunction-sections \