#*******************************************************************************
#
#                   SiRF Technology, Inc. GPS Software                    
#                                                                         
#    Copyright (c) 1996-2015 by SiRF Technology, Inc. a CSR plc Company   
#                          All rights reserved.                           
#                                                                         
#    This Software is protected by United States copyright laws and       
#    international treaties.  You may not reverse engineer, decompile     
#    or disassemble this Software.                                        
#                                                                         
#    WARNING:                                                             
#    This Software contains SiRF Technology Inc.s confidential and        
#    proprietary information. UNAUTHORIZED COPYING, USE, DISTRIBUTION,    
#    PUBLICATION, TRANSFER, SALE, RENTAL OR DISCLOSURE IS PROHIBITED      
#    AND MAY RESULT IN SERIOUS LEGAL CONSEQUENCES.  Do not copy this      
#    Software without SiRF Technology, Inc.s  express written             
#    permission.   Use of any portion of the contents of this Software    
#    is subject to and restricted by your signed written agreement with   
#    SiRF Technology, Inc.                                                
#                                                                             
#*******************************************************************************

# Makefile for SPI SIRFflashEngineEP main program
#
# NOTE:  TOOLCHAIN
#        This project was tested with Beaglebone black board
#        using gcc-linaro-arm-linux-gnueabihf toolchain.
#        Please change the variable CC to the appropriate toolchain
#

TDIR = ../../../src
COMDIR = ../../../../../../../common
VPATH = $(TDIR):$(COMDIR)
LIBDIR = ../../../../../../library

OBJS = main.o imgacc.o errsup.o timsup.o delay.o commio.o coder_spi.o crc.o
LIBS = $(LIBDIR)/builds/linux_gcc/SiRFflashEngineEP/spi_via_kernel_driver/SiRFflashEngineEP_spi.a

CC = /home/user/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc
CFLAGS= -I$(TDIR) -I$(COMDIR) -I$(LIBDIR)/src -O2 -DBINARY_IMAGE_IN_FILE

all: prgflash_spi

prgflash_spi: $(OBJS) $(LIBS) 
	$(CC) $(CFLAGS) -o $@ $^ -ldl

%.o : %.c
	$(CC) -c $(CFLAGS) -o $@ $^

clean:
	rm -f *.o prgflash_spi

.PRECIOUS : %.o


