1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-26 04:53:18 +02:00

some Makefile cleanup (more coming)

This commit is contained in:
shiyele 2009-06-25 02:22:15 +00:00
parent 62d0a53a45
commit 3aea251e8c

View File

@ -1,17 +1,17 @@
# #
# Copyright (C) 2006 Ingenic Semiconductor Inc. # Authors: Lucifer at Ingenic Semiconductor Inc.
# By Lucifer # Xiangfu Liu <xiangfu.z@gmail.com>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or
# it under the terms of the GNU General Public License version 2 as # modify it under the terms of the GNU General Public License
# published by the Free Software Foundation. # as published by the Free Software Foundation; either version
# 2 of the License, or (at your option) any later version.
# #
FLASH_TOOL_BIN_PATH = ../bin
FLASH_TOOL_SRC_PATH = ../src FLASH_TOOL_SRC_PATH = ../src
ifeq ($(CROSS_COMPILE),) ifeq ($(CROSS_COMPILE),)
$(error CROSS_COMPILE variable not set) $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
endif endif
CC := $(CROSS_COMPILE)gcc CC := $(CROSS_COMPILE)gcc
@ -21,54 +21,38 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
NM := $(CROSS_COMPILE)nm NM := $(CROSS_COMPILE)nm
OBJDUMP := $(CROSS_COMPILE)objdump OBJDUMP := $(CROSS_COMPILE)objdump
CFLAGS := -mips32 -O2 -FPIC \ CFLAGS := -mips32 -O2 -fno-exceptions -ffunction-sections \
-fno-exceptions -ffunction-sections \ -fomit-frame-pointer -msoft-float -G 0
-fomit-frame-pointer -msoft-float -G 0
#CFLAGS := -mips32 -O2 -FPIC -mno-abicalls -fno-builtin \
LDFLAGS := -nostdlib -T target.ld $(CFLAGS) LDFLAGS := -nostdlib -T target.ld $(CFLAGS)
LIBS := -lstdc++ -lc -lm -lgcc
LIBS := -lstdc++ -lc -lm -lgcc
USBBOOTDIR := . USBBOOTDIR := .
LIBDIR :=
#SOURCES += $(wildcard $(USBBOOTDIR)/usb_boot/*.c)
SOURCES := ./usb_boot/main.c \ SOURCES := ./usb_boot/main.c \
./usb_boot/udc.c \ ./usb_boot/udc.c \
./usb_boot/cache.c \ ./usb_boot/cache.c \
./usb_boot/serial.c \ ./usb_boot/serial.c \
./usb_boot/boothandler.c ./usb_boot/boothandler.c \
SOURCES += $(wildcard $(USBBOOTDIR)/nandflash/*.c) ./nandflash/nandflash_4740.c \
SOURCES += $(wildcard $(USBBOOTDIR)/usb_boot/*.S) ./nandflash/nandflash_4750.c
HEADS := $(SOCDIR)/head.S CFLAGS += -I$(USBBOOTDIR)/usb_boot \
CFLAGS += -I$(SOCDIR)/include -I$(USBBOOTDIR)/usb_boot \
-I$(USBBOOTDIR)/nandflash -I$(USBBOOTDIR)/include \ -I$(USBBOOTDIR)/nandflash -I$(USBBOOTDIR)/include \
-I$(FLASH_TOOL_SRC_PATH) -I$(FLASH_TOOL_SRC_PATH)
OBJS := $(addsuffix .o , $(basename $(notdir $(SOURCES)))) OBJS := $(addsuffix .o , $(basename $(notdir $(SOURCES))))
HEADO := $(addsuffix .o , $(basename $(notdir $(HEADS))))
TARGET := usb_boot APP := xburst_stage2.elf
APP := $(TARGET).elf
VPATH := $(ARCHDIR) $(SOCDIR) $(OSDIR) $(USBBOOTDIR)/usb_boot \ VPATH := $(USBBOOTDIR)/usb_boot $(USBBOOTDIR)/nandflash
$(USBBOOTDIR)/norflash $(USBBOOTDIR)/nandflash
all: $(APP) all: $(APP)
$(OBJCOPY) -O binary $(APP) $(TARGET).bin $(OBJCOPY) -O binary $(APP) xburst_stage2.bin
$(OBJDUMP) -D $(APP) > $(TARGET).dump $(OBJDUMP) -D $(APP) > xburst_stage2.dump
$(NM) $(APP) | sort > $(TARGET).sym $(NM) $(APP) | sort > xburst_stage2.sym
$(OBJDUMP) -h $(APP) > $(TARGET).map $(OBJDUMP) -h $(APP) > xburst_stage2.map
mkdir -p $(FLASH_TOOL_BIN_PATH)
cp $(TARGET).bin $(FLASH_TOOL_BIN_PATH)
$(APP): $(HEADO) $(OBJS) $(EXTLIBS) $(APP): head.o $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@ $(CC) $(LDFLAGS) $^ -o $@
.c.o: .c.o:
@ -79,4 +63,5 @@ $(APP): $(HEADO) $(OBJS) $(EXTLIBS)
$(CC) $(CFLAGS) -o $@ -c $< $(CC) $(CFLAGS) -o $@ -c $<
clean: clean:
rm -fr *.o $(APP) $(OBJS) core $(OTHER) *.sym *.map *.dump *.bin *.lib *~ *.\# rm -f $(addprefix xburst_stage2., bin dump elf map sym)
rm -f $(OBJS)