#! gmake

#
# Copyright (C) 2006 Laurent Bessard
#
# This file is part of canfestival, a library implementing the canopen
# stack
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

#Global settings

export PREFIX = $(PROJWD)/../local/gpllib
export CF_TARGET = unix
export CAN_DRIVER = can_4linux
export TIMERS_DRIVER = timers_uclinux

CFL=$(shell pwd)


INCLUDES += -I$(CFL)/include
INCLUDES += -I$(CFL)/include/$(CF_TARGET)
INCLUDES += -I$(CFL)/include/$(TIMERS_DRIVER)

export INCLUDES

export CFLAGS += -DPRG_IEC -DHW_MCF -Wa,--register-prefix-optional \
	-Wa,-I$(PROJWD)/src/saglib/include \
	-Wa,-I$(PROJWD)/src/hw_$(HW)  \
	-DNOT_USE_DYNAMIC_LOADING \
	-DCANOPEN_BIG_ENDIAN \
	$(INCLUDES) \
	$(DB_INCS) \

export CXXFLAGS = $(CFLAGS)

#all: objdictedit canfestival examples
all: canfestival

#examples: canfestival driver
#	$(MAKE) -C examples all

documentation:
	$(MAKE) -C doc/doxygen

manual:
	$(MAKE) -C doc/manual

#objdictedit:
#	$(MAKE) -C objdictgen all

canfestival: driver
	$(MAKE) -C src all

driver:
	$(MAKE) -C drivers all

install: canfestival driver
	$(MAKE) -C drivers install
	$(MAKE) -C src install
#	$(MAKE) -C examples install
#	$(MAKE) -C objdictgen install
#	ldconfig

uninstall:
	$(MAKE) -C drivers uninstall
	$(MAKE) -C src uninstall
#	$(MAKE) -C examples $@
#	$(MAKE) -C objdictgen $@

clean:
	$(MAKE) -C src clean
	$(MAKE) -C drivers clean
#	$(MAKE) -C examples $@
#	$(MAKE) -C objdictgen $@

mrproper: clean
	$(MAKE) -C src $@
	$(MAKE) -C drivers $@
#	$(MAKE) -C examples $@
#	$(MAKE) -C objdictgen $@

