1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-26 16:09:22 +02:00
xburst-tools/qiboot/Makefile
Andy Green 064a13861c qi-refactor-for-multi-cpu-add-s3c6410-base.patch
This patch makes qi source structure cpu-centric, and allows multiple CPUs
to be handled with the board definitions inside the CPU dirs.

You have to make a particular CPU version of Qi now, which you can do by
a shell command like this:

make clean ; make CPU=s3c2442 && make CPU=s3c6410

which gets you

$ ls -l image/
total 744
-rwxrwxr-x 1 agreen agreen  25372 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf
-rw-rw-r-- 1 agreen agreen 237100 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf.dis
-rw-rw-r-- 1 agreen agreen  25388 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf.udfu
-rwxrwxr-x 1 agreen agreen  22736 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf
-rw-rw-r-- 1 agreen agreen 216294 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf.dis
-rw-rw-r-- 1 agreen agreen  22752 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf.udfu

The 6410 support in there is enough to send a character "U" on the 6410 SMDK

Because the product naming is not defined, currently the device targeted for 6410
is called "TLA01"

Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-28 10:16:40 +00:00

81 lines
2.5 KiB
Makefile

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include config.mk
BUILD_DATE := $(shell date)
BUILD_HOST := $(shell hostname)
BUILD_BRANCH := $(shell git branch | grep ^\* | cut -d' ' -f2)
BUILD_HEAD := $(shell git show --pretty=oneline | head -n1 | cut -d' ' -f1 | cut -b1-16)
BUILD_VERSION := ${BUILD_BRANCH}_${BUILD_HEAD}
LDS = src/cpu/$(CPU)/qi.lds
INCLUDE = include
IMAGE_DIR = image
TOOLS = tools
CFLAGS = -Wall -Werror -I $(INCLUDE) -g -c -Os -fno-strict-aliasing -mlong-calls \
-fno-common -ffixed-r8 -msoft-float -fno-builtin -ffreestanding \
-march=armv4t -mno-thumb-interwork -Wstrict-prototypes \
-DBUILD_HOST="${BUILD_HOST}" -DBUILD_VERSION="${BUILD_VERSION}" \
-DBUILD_DATE="${BUILD_DATE}"
LDFLAGS =
S_SRCS = src/cpu/$(CPU)/start.S src/lowlevel_init.S
S_OBJS = $(patsubst %.S,%.o, $(S_SRCS))
C_SRCS = $(wildcard src/*.c) \
$(wildcard src/drivers/*.c) $(wildcard src/fs/*.c) \
$(wildcard src/cpu/$(CPU)/*.c)
C_OBJS = $(patsubst %.c,%.o, $(C_SRCS))
SRCS = ${S_SRCS} ${C_SRCS}
OBJS = ${S_OBJS} ${C_OBJS}
LIBS = -L${COMPILER_LIB_PATH} -lgcc
# GTA02 A5 and A6 U-Boot will eat these for DFU action
UDFU_VID = 0x1d50
UDFU_PID = 0x5119
UDFU_REV = 0x350
TARGET = image/start_qi_all-$(CPU)
IMAGE = $(IMAGE_DIR)/qi-$(CPU)-$(BUILD_VERSION)
UDFU_IMAGE = $(IMAGE_DIR)/qi-$(CPU)-$(BUILD_VERSION).udfu
MKUDFU = $(TOOLS)/mkudfu
%.o: %.S
@$(CC) $(CFLAGS) -o $@ $<
%.o: %.c
@$(CC) $(CFLAGS) -o $@ $<
all:${UDFU_IMAGE}
${OBJS}:${SRCS} ${INCLUDE}/*.h
${MKUDFU}:
make -C $(TOOLS)
${UDFU_IMAGE}:${OBJS} ${MKUDFU}
@$(LD) ${LDFLAGS} -T$(LDS) -g $(OBJS) -o ${TARGET} ${LIBS}
@$(OBJCOPY) -O binary -S ${TARGET} ${IMAGE}
@$(MKUDFU) -v ${UDFU_VID} -p ${UDFU_PID} -r ${UDFU_REV} \
-d ${IMAGE} ${UDFU_IMAGE}
@$(OBJDUMP) -d ${TARGET} >${IMAGE}.dis
clean:
@rm -f src/*.o src/*~ include/*~ ${IMAGE_DIR}/* ${TARGET} ${UDFU_IMAGE}
@make clean -C $(TOOLS)