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/lan.c
SRC += src/plugins/lan/auth.c
SRC += src/plugins/lan/md5.c
#SRC += lib/log.c
SRC += lib/helper.c
SRC += lib/ipmi_strings.c
SRC += lib/ipmi_main.c
SRC += lib/ipmi_raw.c

#SRC += lib/ipmi_delloem.c
SRC += lib/ipmi_oem.c
SRC += lib/ipmi_sdr.c
#SRC += lib/ipmi_sel.c
SRC += lib/dimm_spd.c
SRC += lib/ipmi_sdradd.c
SRC += lib/ipmi_sel.c
SRC += lib/ipmi_sensor.c
SRC += lib/ipmi_fru.c
SRC += lib/hpm2.c





#SRC += $(wildcard ./lib/*.c) 

#incldue
CFLAGS	+= -I$(INSTALL_ROOT)/A2F/root/usr/include
CFLAGS	+= -I ./include
CFLAGS  += -I ./src/plugins/lan
CFLAGS  += -I ./src/plugins/bmc
CFLAGS  += -I ./src/plugins/dummy
CFLAGS  += -I ./src/plugins/free
CFLAGS  += -I ./src/plugins/imb
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



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


#object
OBJS	= $(SRC:%.c=%.o)
clean:
	rm -rf $(EXEC) $(OBJS)


