EXEC		= ipmitool

CFLAGS		:= -Os -mcpu=cortex-m3 -mthumb
LDFLAGS		:= -mcpu=cortex-m3 -mthumb -L$(INSTALL_ROOT)/A2F/root/usr/lib



CC	= $(CROSS_COMPILE_APPS)gcc

#source
SRC	= ./src/ipmitool.c

SRC += ./src/plugins/ipmi_intf.c
SRC += ./src/plugins/lan/auth.c
SRC += ./src/plugins/lan/md5.c
SRC += ./src/plugins/lan/lan.c

SRC += ./lib/log.c
SRC += ./lib/helper.c
SRC += ./lib/hpm2.c
SRC += ./lib/dimm_spd.c
SRC += ./lib/ipmi_strings.c
SRC += ./lib/ipmi_sdr.c
SRC += ./lib/ipmi_sensor.c
SRC += ./lib/ipmi_sel.c
SRC += ./lib/ipmi_mc.c
SRC += ./lib/ipmi_sdradd.c
SRC += ./lib/ipmi_oem.c
SRC += ./lib/ipmi_fru.c
SRC += ./lib/ipmi_raw.c
SRC += ./lib/ipmi_main.c
SRC += ./lib/ipmi_picmg.c
SRC += ./lib/ipmi_vita.c
SRC += ./lib/ipmi_kontronoem.c
SRC += ./lib/ipmi_chassis.c
SRC += ./lib/ipmi_user.c

#incldue
CFLAGS	+= -I$(INSTALL_ROOT)/A2F/root/usr/include
CFLAGS	+= -I ./
CFLAGS	+= -I ./src/plugins
CFLAGS	+= -I ./src/plugins/bmc
CFLAGS	+= -I ./src/plugins/dummy
CFLAGS	+= -I ./src/plugins/free
CFLAGS	+= -I ./src/plugins/imb
CFLAGS	+= -I ./src/plugins/lan
CFLAGS	+= -I ./src/plugins/lanplus
CFLAGS	+= -I ./src/plugins/lipmi
CFLAGS	+= -I ./src/plugins/open
CFLAGS	+= -I ./src/plugins/serial
CFLAGS	+= -I ./src/plugins/usb

CFLAGS	+= -I ./include
CFLAGS	+= -I ./include/ipmitool





$(EXEC): $(SRC)
	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS) -lpthread -lm -lc



#object
OBJS	:= $(SRC:%.c=%.o)

clean:
	rm -f $(EXEC) $(OBJS)
	rm -f *.gdb


