# I2C tools for Linux
#
# Copyright (C) 2007-2012  Jean Delvare <jdelvare@suse.de>
#
# 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.

TARGET = i2c-tools

ifndef EC_TARGET_DIR
EC_TARGET_DIR := $(EC_ROOT)/targetfs/usr/local
endif

ifndef EC_CXX
EC_CXX := /opt/poky/1.6.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
endif

DESTDIR	=
prefix	= $(EC_TARGET_DIR)
bindir	= $(prefix)/bin
sbindir	= $(bindir)
mandir	= $(prefix)/../share/man
man8dir	= $(mandir)
incdir	= $(prefix)/include

INSTALL		:= install
INSTALL_DATA	:= $(INSTALL) -m 644
INSTALL_DIR	:= $(INSTALL) -m 755 -d
INSTALL_PROGRAM	:= $(INSTALL) -m 755
RM		:= rm -f

CC ?= $(EC_CXX)

CFLAGS	?= -O2
# When debugging, use the following instead
#CFLAGS	:= -O -g
CFLAGS	+= -Wall

#KERNELVERSION	:= $(shell uname -r)

.PHONY: all strip clean install uninstall

all:
	@echo '***************************************'
	@echo 'Succeed to build target: $@'
	@echo '***************************************'

install:
	@echo '***************************************'
	@echo 'Succeed to install target: $(TARGET)'
	@echo '***************************************'

#EXTRA	+= py-smbus
SRCDIRS	:= include eeprom stub tools $(EXTRA)
include $(SRCDIRS:%=%/Module.mk)
