1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-27 03:35:19 +02:00
xburst-tools/flash-tool/Makefile

69 lines
1.8 KiB
Makefile
Raw Normal View History

2009-04-22 21:22:16 +03:00
#
# "Ingenic flash tool" - flash the Ingenic CPU via USB
#
# (C) Copyright 2009
# Author: Marek Lindner <lindner_marek@yahoo.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 3 as published by the Free Software Foundation.
# 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., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
Q_CC = @echo ' ' CC $@;
Q_LD = @echo ' ' LD $@;
export Q_CC
export Q_LD
endif
endif
STAGE1_PATH = ./device_stage1
STAGE2_PATH = ./device_stage2
CROSS_COMPILE ?= mipsel-linux-
2009-04-22 21:22:16 +03:00
CC = gcc
CFLAGS += -pedantic -Wall -W -O1 -g3 -std=gnu99
2009-04-27 11:54:10 +03:00
LDFLAGS += -lusb -lconfuse
2009-04-22 21:22:16 +03:00
BINARY_NAME = inflash
TARGETS = $(BINARY_NAME) stage1 stage2
2009-04-22 21:22:16 +03:00
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 \
command_line.h cmd.h config.h
2009-04-22 21:22:16 +03:00
SRC_O= $(SRC_C:.c=.o)
default: $(TARGETS)
$(BINARY_NAME): $(SRC_O) $(SRC_H) Makefile
2009-04-22 21:22:16 +03:00
$(Q_LD)$(CC) -o $@ $(SRC_O) $(LDFLAGS)
.c.o:
$(Q_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MD -c $< -o $@
-include $(SRC_C:.c=.d)
# for the device stage
stage1:
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
stage2:
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
2009-04-22 21:22:16 +03:00
clean:
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH) clean
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH) clean
2009-04-28 18:56:32 +03:00
rm -f $(BINARY_NAME) *.o *~
2009-04-22 21:22:16 +03:00
rm -f `find . -name '*.d' -print`