#
#   goahead-linux-static.mk -- Makefile to build Embedthis GoAhead for linux
#

NAME                  := goahead
VERSION               := 3.6.5
PROFILE               ?= static
ARCH                  ?= $(shell uname -m | sed 's/i.86/x86/;s/x86_64/x64/;s/arm.*/arm/;s/mips.*/mips/')
CC_ARCH               ?= $(shell echo $(ARCH) | sed 's/x86/i686/;s/x64/x86_64/')
OS                    ?= linux
CC                    ?= gcc
CONFIG                ?= $(OS)-$(ARCH)-$(PROFILE)
BUILD                 ?= build/$(CONFIG)
LBIN                  ?= $(BUILD)/bin
PATH                  := $(LBIN):$(PATH)

ME_COM_COMPILER       ?= 1
ME_COM_LIB            ?= 1
ME_COM_MATRIXSSL      ?= 0
ME_COM_MBEDTLS        ?= 1
ME_COM_NANOSSL        ?= 0
ME_COM_OPENSSL        ?= 0
ME_COM_OSDEP          ?= 1
ME_COM_SSL            ?= 1
ME_COM_VXWORKS        ?= 0

ME_COM_OPENSSL_PATH   ?= "/usr/lib"

ifeq ($(ME_COM_LIB),1)
    ME_COM_COMPILER := 1
endif
ifeq ($(ME_COM_MBEDTLS),1)
    ME_COM_SSL := 1
endif
ifeq ($(ME_COM_OPENSSL),1)
    ME_COM_SSL := 1
endif
#CFLAGS                += -Wl,-z,noexecstatck -fstack-protector -Wformat-security -Wl,-z,relro,-z,now --param=ssp-buffer-size=4 -Wl,--no-copy-dt-needed-entries -pie -fPIE -w
CFLAGS                +=  -Wformat  -Wl,--as-needed  -Wl,-z,noexecheap 
#CFLAGS 				  += -fno-stack-protector
DFLAGS                += -DME_DEBUG=1 $(patsubst %,-D%,$(filter ME_%,$(MAKEFLAGS))) -DME_COM_COMPILER=$(ME_COM_COMPILER) -DME_COM_LIB=$(ME_COM_LIB) -DME_COM_MATRIXSSL=$(ME_COM_MATRIXSSL) -DME_COM_MBEDTLS=$(ME_COM_MBEDTLS) -DME_COM_NANOSSL=$(ME_COM_NANOSSL) -DME_COM_OPENSSL=$(ME_COM_OPENSSL) -DME_COM_OSDEP=$(ME_COM_OSDEP) -DME_COM_SSL=$(ME_COM_SSL) -DME_COM_VXWORKS=$(ME_COM_VXWORKS) 
IFLAGS                += "-I$(BUILD)/inc"
LDFLAGS               += 
LIBPATHS              += -L$(BUILD)/bin
LIBS                  += -lrt -lpthread -lm  #-ldl

DEBUG                 ?= debug
CFLAGS-debug          ?= -g
DFLAGS-debug          ?= -DME_DEBUG
LDFLAGS-debug         ?= -g
DFLAGS-release        ?= 
CFLAGS-release        ?= -O2
LDFLAGS-release       ?= 
CFLAGS                += $(CFLAGS-$(DEBUG))
DFLAGS                += $(DFLAGS-$(DEBUG))
LDFLAGS               += $(LDFLAGS-$(DEBUG))

ME_ROOT_PREFIX        ?= 
ME_BASE_PREFIX        ?= $(ME_ROOT_PREFIX)/usr/local
ME_DATA_PREFIX        ?= $(ME_ROOT_PREFIX)/
ME_STATE_PREFIX       ?= $(ME_ROOT_PREFIX)/var
ME_APP_PREFIX         ?= $(ME_BASE_PREFIX)/lib/$(NAME)
ME_VAPP_PREFIX        ?= $(ME_APP_PREFIX)/$(VERSION)
ME_BIN_PREFIX         ?= $(ME_ROOT_PREFIX)/usr/local/bin
ME_INC_PREFIX         ?= $(ME_ROOT_PREFIX)/usr/local/include
ME_LIB_PREFIX         ?= $(ME_ROOT_PREFIX)/usr/local/lib
ME_MAN_PREFIX         ?= $(ME_ROOT_PREFIX)/usr/local/share/man
ME_SBIN_PREFIX        ?= $(ME_ROOT_PREFIX)/usr/local/sbin
ME_ETC_PREFIX         ?= $(ME_ROOT_PREFIX)/etc/$(NAME)
ME_WEB_PREFIX         ?= $(ME_ROOT_PREFIX)/var/www/$(NAME)
ME_LOG_PREFIX         ?= $(ME_ROOT_PREFIX)/var/log/$(NAME)
ME_SPOOL_PREFIX       ?= $(ME_ROOT_PREFIX)/var/spool/$(NAME)
ME_CACHE_PREFIX       ?= $(ME_ROOT_PREFIX)/var/spool/$(NAME)/cache
ME_SRC_PREFIX         ?= $(ME_ROOT_PREFIX)$(NAME)-$(VERSION)


TARGETS               += $(BUILD)/bin/goahead
#TARGETS               += $(BUILD)/bin/goahead-test
TARGETS               += $(BUILD)/bin/gopass

unexport CDPATH

ifndef SHOW
.SILENT:
endif

all build compile: prep $(TARGETS)

.PHONY: prep

prep:
	@echo "      [Info] Use "make SHOW=1" to trace executed commands."
	@if [ "$(CONFIG)" = "" ] ; then echo WARNING: CONFIG not set ; exit 255 ; fi
	@if [ "$(ME_APP_PREFIX)" = "" ] ; then echo WARNING: ME_APP_PREFIX not set ; exit 255 ; fi
	@[ ! -x $(BUILD)/bin ] && mkdir -p $(BUILD)/bin; true
	@[ ! -x $(BUILD)/inc ] && mkdir -p $(BUILD)/inc; true
	@[ ! -x $(BUILD)/obj ] && mkdir -p $(BUILD)/obj; true
	@[ ! -f $(BUILD)/inc/me.h ] && cp projects/goahead-linux-static-me.h $(BUILD)/inc/me.h ; true
	@if ! diff $(BUILD)/inc/me.h projects/goahead-linux-static-me.h >/dev/null ; then\
		cp projects/goahead-linux-static-me.h $(BUILD)/inc/me.h  ; \
	fi; true
	@if [ -f "$(BUILD)/.makeflags" ] ; then \
		if [ "$(MAKEFLAGS)" != "`cat $(BUILD)/.makeflags`" ] ; then \
			echo "   [Warning] Make flags have changed since the last build" ; \
			echo "   [Warning] Previous build command: "`cat $(BUILD)/.makeflags`"" ; \
		fi ; \
	fi
	@echo "$(MAKEFLAGS)" >$(BUILD)/.makeflags

clean:
	rm -f $(BUILD)/obj/*.o
	rm -f "$(BUILD)/bin/goahead"
	rm -f "$(BUILD)/bin/goahead-test"
	rm -f "$(BUILD)/bin/gopass"
	rm -f "$(BUILD)/.install-certs-modified"
	rm -f "$(BUILD)/bin/libgo.a"
	rm -f "$(BUILD)/bin/libgoahead-mbedtls.a"
	rm -f "$(BUILD)/bin/libmbedtls.a"

clobber: clean
	rm -fr ./$(BUILD)

#
#   embedtls.h
#
DEPS_1 += src/mbedtls/embedtls.h

$(BUILD)/inc/embedtls.h: $(DEPS_1)
	@echo '      [Copy] $(BUILD)/inc/embedtls.h'
	mkdir -p "$(BUILD)/inc"
	cp src/mbedtls/embedtls.h $(BUILD)/inc/embedtls.h

#
#   me.h
#

$(BUILD)/inc/me.h: $(DEPS_2)

#
#   osdep.h
#
DEPS_3 += src/osdep/osdep.h
DEPS_3 += $(BUILD)/inc/me.h

$(BUILD)/inc/osdep.h: $(DEPS_3)
	@echo '      [Copy] $(BUILD)/inc/osdep.h'
	mkdir -p "$(BUILD)/inc"
	cp src/osdep/osdep.h $(BUILD)/inc/osdep.h

#
#   goahead.h
#
DEPS_4 += src/goahead.h
DEPS_4 += $(BUILD)/inc/me.h
DEPS_4 += $(BUILD)/inc/osdep.h

$(BUILD)/inc/goahead.h: $(DEPS_4)
	@echo '      [Copy] $(BUILD)/inc/goahead.h'
	mkdir -p "$(BUILD)/inc"
	cp src/goahead.h $(BUILD)/inc/goahead.h

#
#   js.h
#
DEPS_5 += src/js.h
DEPS_5 += $(BUILD)/inc/goahead.h

$(BUILD)/inc/js.h: $(DEPS_5)
	@echo '      [Copy] $(BUILD)/inc/js.h'
	mkdir -p "$(BUILD)/inc"
	cp src/js.h $(BUILD)/inc/js.h

#
#   mbedtls.h
#
DEPS_6 += src/mbedtls/mbedtls.h

$(BUILD)/inc/mbedtls.h: $(DEPS_6)
	@echo '      [Copy] $(BUILD)/inc/mbedtls.h'
	mkdir -p "$(BUILD)/inc"
	cp src/mbedtls/mbedtls.h $(BUILD)/inc/mbedtls.h











#################### jimbo modify ###########################
#
#   cJSON
#
DEPS_USER_H1 += src/cJSON/cJSON.h
DEPS_USER_H1 += $(BUILD)/inc/goahead.h

$(BUILD)/inc/cJSON.h: $(DEPS_USER_H1)
	@echo '      [Copy] $(BUILD)/inc/cJSON.h'
	mkdir -p "$(BUILD)/inc"
	cp src/cJSON/cJSON.h $(BUILD)/inc/cJSON.h

#
#	libipmi
#
DEPS_USER_H2 += src/libipmi/inc/libipmi_session.h
DEPS_USER_H2 += src/libipmi/inc/libipmi.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_errorcodes.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_struct.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_IPM.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_AppDevice.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_ChassisDevice.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_fru.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_PEF.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_rmcp.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_sdr.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_sensor.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_StorDevice.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_storlead_OEM.h
DEPS_USER_H2 += src/libipmi/inc/libipmi_usermgmt.h
DEPS_USER_H2 += src/libipmi/inc/libsensor.h
DEPS_USER_H2 += src/libipmi/inc/sensor_helpers.h
DEPS_USER_H2 += ../common_include/com_IPMI_AppDevice.h
DEPS_USER_H2 += ../common_include/com_IPMI_AppDevice+.h
DEPS_USER_H2 += ../common_include/com_IPMIDefs.h
DEPS_USER_H2 += ../common_include/com_IPMI_IPM.h
DEPS_USER_H2 += ../common_include/com_IPMI_App.h
DEPS_USER_H2 += ../common_include/com_IPMI_Chassis.h
DEPS_USER_H2 += ../common_include/com_IPMI_ChassisDevice.h
DEPS_USER_H2 += ../common_include/com_IPMI_FRU.h
DEPS_USER_H2 += ../common_include/com_IPMI_SDRRecord.h
DEPS_USER_H2 += ../common_include/com_IPMI_SDR.h
DEPS_USER_H2 += ../common_include/com_IPMI_SensorEvent.h
DEPS_USER_H2 += ../common_include/com_IPMI_Sensor.h
DEPS_USER_H2 += ../common_include/com_IPMI_SEL.h
DEPS_USER_H2 += ../common_include/com_IPMI_IPMB.h
DEPS_USER_H2 += ../common_include/com_IPMI_Storage.h
DEPS_USER_H2 += ../common_include/com_IPMI_LANConfig.h
DEPS_USER_H2 += ../common_include/com_IPMI_PEF.h
DEPS_USER_H2 += ../common_include/com_IPMI_RMCP.h
DEPS_USER_H2 += ../common_include/com_BmcType.h
DEPS_USER_H2 += ../common_include/com_IPMI_Storlead.h
DEPS_USER_H2 += ../common_include/com_BMCCfg.h


$(BUILD)/inc/libipmi_session.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_session.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_session.h $(BUILD)/inc/libipmi_session.h
$(BUILD)/inc/libipmi.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi.h $(BUILD)/inc/libipmi.h
$(BUILD)/inc/libipmi_errorcodes.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_errorcodes.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_errorcodes.h $(BUILD)/inc/libipmi_errorcodes.h
$(BUILD)/inc/libipmi_struct.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_struct.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_struct.h $(BUILD)/inc/libipmi_struct.h
$(BUILD)/inc/libipmi_IPM.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_IPM.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_IPM.h $(BUILD)/inc/libipmi_IPM.h
$(BUILD)/inc/libipmi_AppDevice.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_AppDevice.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_AppDevice.h $(BUILD)/inc/libipmi_AppDevice.h
$(BUILD)/inc/libipmi_ChassisDevice.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_ChassisDevice.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_ChassisDevice.h $(BUILD)/inc/libipmi_ChassisDevice.h
$(BUILD)/inc/libipmi_fru.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_fru.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_fru.h $(BUILD)/inc/libipmi_fru.h
$(BUILD)/inc/libipmi_PEF.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_PEF.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_PEF.h $(BUILD)/inc/libipmi_PEF.h
$(BUILD)/inc/libipmi_rmcp.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_rmcp.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_rmcp.h $(BUILD)/inc/libipmi_rmcp.h
$(BUILD)/inc/libipmi_sdr.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_sdr.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_sdr.h $(BUILD)/inc/libipmi_sdr.h
$(BUILD)/inc/libipmi_sensor.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_sensor.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_sensor.h $(BUILD)/inc/libipmi_sensor.h
$(BUILD)/inc/libipmi_StorDevice.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_StorDevice.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_StorDevice.h $(BUILD)/inc/libipmi_StorDevice.h
$(BUILD)/inc/libipmi_storlead_OEM.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_storlead_OEM.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_storlead_OEM.h $(BUILD)/inc/libipmi_storlead_OEM.h
$(BUILD)/inc/libipmi_usermgmt.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libipmi_usermgmt.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libipmi_usermgmt.h $(BUILD)/inc/libipmi_usermgmt.h
$(BUILD)/inc/libsensor.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/libsensor.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/libsensor.h $(BUILD)/inc/libsensor.h
$(BUILD)/inc/sensor_helpers.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/sensor_helpers.h'
	mkdir -p "$(BUILD)/inc"
	cp src/libipmi/inc/sensor_helpers.h $(BUILD)/inc/sensor_helpers.h

$(BUILD)/inc/com_IPMI_AppDevice.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_AppDevice.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_AppDevice.h $(BUILD)/inc/com_IPMI_AppDevice.h
$(BUILD)/inc/com_IPMI_AppDevice+.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_AppDevice+.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_AppDevice+.h $(BUILD)/inc/com_IPMI_AppDevice+.h
$(BUILD)/inc/com_IPMIDefs.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMIDefs.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMIDefs.h $(BUILD)/inc/com_IPMIDefs.h
$(BUILD)/inc/com_IPMI_IPM.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_IPM.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_IPM.h $(BUILD)/inc/com_IPMI_IPM.h
$(BUILD)/inc/com_IPMI_App.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_App.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_App.h $(BUILD)/inc/com_IPMI_App.h
$(BUILD)/inc/com_IPMI_Chassis.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_Chassis.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_Chassis.h $(BUILD)/inc/com_IPMI_Chassis.h
$(BUILD)/inc/com_IPMI_ChassisDevice.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_ChassisDevice.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_ChassisDevice.h $(BUILD)/inc/com_IPMI_ChassisDevice.h
$(BUILD)/inc/com_IPMI_FRU.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_FRU.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_FRU.h $(BUILD)/inc/com_IPMI_FRU.h
$(BUILD)/inc/com_IPMI_SDRRecord.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_SDRRecord.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_SDRRecord.h $(BUILD)/inc/com_IPMI_SDRRecord.h
$(BUILD)/inc/com_IPMI_SDR.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_SDR.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_SDR.h $(BUILD)/inc/com_IPMI_SDR.h
$(BUILD)/inc/com_IPMI_SensorEvent.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_SensorEvent.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_SensorEvent.h $(BUILD)/inc/com_IPMI_SensorEvent.h
$(BUILD)/inc/com_IPMI_Sensor.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_Sensor.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_Sensor.h $(BUILD)/inc/com_IPMI_Sensor.h
$(BUILD)/inc/com_IPMI_SEL.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_SEL.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_SEL.h $(BUILD)/inc/com_IPMI_SEL.h
$(BUILD)/inc/com_IPMI_IPMB.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_IPMB.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_IPMB.h $(BUILD)/inc/com_IPMI_IPMB.h
$(BUILD)/inc/com_IPMI_Storage.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_Storage.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_Storage.h $(BUILD)/inc/com_IPMI_Storage.h
$(BUILD)/inc/com_IPMI_LANConfig.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_LANConfig.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_LANConfig.h $(BUILD)/inc/com_IPMI_LANConfig.h
$(BUILD)/inc/com_IPMI_PEF.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_PEF.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_PEF.h $(BUILD)/inc/com_IPMI_PEF.h
$(BUILD)/inc/com_IPMI_RMCP.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_RMCP.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_RMCP.h $(BUILD)/inc/com_IPMI_RMCP.h
$(BUILD)/inc/com_BmcType.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_BmcType.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_BmcType.h $(BUILD)/inc/com_BmcType.h
$(BUILD)/inc/com_IPMI_Storlead.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_IPMI_Storlead.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_IPMI_Storlead.h $(BUILD)/inc/com_IPMI_Storlead.h
$(BUILD)/inc/com_BMCCfg.h: $(DEPS_USER_H2)
	@echo '      [Copy] $(BUILD)/inc/com_BMCCfg.h'
	mkdir -p "$(BUILD)/inc"
	cp ../common_include/com_BMCCfg.h $(BUILD)/inc/com_BMCCfg.h

#
#   LUSA, ResultUtils
#
DEPS_USER_H3 += src/utils/mine/ResultUtils.h
DEPS_USER_H3 += $(BUILD)/inc/goahead.h

$(BUILD)/inc/ResultUtils.h: $(DEPS_USER_H3)
	@echo '      [Copy] $(BUILD)/inc/ResultUtils.h'
	mkdir -p "$(BUILD)/inc"
	cp src/utils/mine/ResultUtils.h $(BUILD)/inc/ResultUtils.h


#
#   web_interface
#
DEPS_USER_H4 += src/web_interface/inc/config.h
DEPS_USER_H4 += src/web_interface/inc/dashboard.h
DEPS_USER_H4 += src/web_interface/inc/fan.h
DEPS_USER_H4 += src/web_interface/inc/fru.h
DEPS_USER_H4 += src/web_interface/inc/fw_update.h
DEPS_USER_H4 += src/web_interface/inc/remote_control.h
DEPS_USER_H4 += src/web_interface/inc/sel.h
DEPS_USER_H4 += src/web_interface/inc/server_health.h
DEPS_USER_H4 += src/web_interface/inc/user.h
DEPS_USER_H4 += $(BUILD)/inc/goahead.h

$(BUILD)/inc/config.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/config.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/config.h $(BUILD)/inc/config.h
$(BUILD)/inc/dashboard.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/dashboard.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/dashboard.h $(BUILD)/inc/dashboard.h
$(BUILD)/inc/fan.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/fan.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/fan.h $(BUILD)/inc/fan.h
$(BUILD)/inc/fru.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/fru.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/fru.h $(BUILD)/inc/fru.h
$(BUILD)/inc/fw_update.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/fw_update.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/fw_update.h $(BUILD)/inc/fw_update.h
$(BUILD)/inc/remote_control.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/remote_control.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/remote_control.h $(BUILD)/inc/remote_control.h
$(BUILD)/inc/sel.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/sel.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/sel.h $(BUILD)/inc/sel.h
$(BUILD)/inc/server_health.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/server_health.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/server_health.h $(BUILD)/inc/server_health.h
$(BUILD)/inc/user.h: $(DEPS_USER_H4)
	@echo '      [Copy] $(BUILD)/inc/user.h'
	mkdir -p "$(BUILD)/inc"
	cp src/web_interface/inc/user.h $(BUILD)/inc/user.h


DEPS_USER_C1 += $(BUILD)/inc/goahead.h
DEPS_USER_C1 += $(BUILD)/inc/cJSON.h

$(BUILD)/obj/cJSON.o: \
    src/cJSON/cJSON.c $(DEPS_USER_C1)
	@echo '   [Compile] $(BUILD)/obj/cJSON.o'
	$(CC) -c -o $(BUILD)/obj/cJSON.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" -DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) "-I$(ME_COM_OPENSSL_PATH)/include" src/cJSON/cJSON.c

DEPS_USER_C2 += $(BUILD)/inc/libipmi_fru.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_session.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_errorcodes.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_struct.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_IPM.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_PEF.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_rmcp.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_sdr.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_sensor.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_StorDevice.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_storlead_OEM.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_usermgmt.h
DEPS_USER_C2 += $(BUILD)/inc/libsensor.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_ChassisDevice.h
DEPS_USER_C2 += $(BUILD)/inc/libipmi_AppDevice.h
DEPS_USER_C2 += $(BUILD)/inc/sensor_helpers.h


DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_AppDevice.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_AppDevice+.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMIDefs.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_IPM.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_App.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_ChassisDevice.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_Chassis.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_SEL.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_FRU.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_IPMB.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_Storage.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_SDR.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_SensorEvent.h
DEPS_USER_C2 += $(BUILD)/inc/com_BmcType.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_Sensor.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_SDRRecord.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_PEF.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_Storlead.h
DEPS_USER_C2 += $(BUILD)/inc/com_IPMI_LANConfig.h
DEPS_USER_C2 += $(BUILD)/inc/com_BMCCfg.h


$(BUILD)/obj/libipmi_session.o: \
    src/libipmi/src/libipmi_session.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_session.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_session.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" -DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) "-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_session.c
$(BUILD)/obj/libipmi_uds_session.o: \
    src/libipmi/src/libipmi_uds_session.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_uds_session.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_uds_session.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" -DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) "-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_uds_session.c
$(BUILD)/obj/libipmi_IPM.o: \
    src/libipmi/src/libipmi_IPM.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_IPM.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_IPM.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" -DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) "-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_IPM.c
$(BUILD)/obj/libipmi_Chassis.o: \
    src/libipmi/src/libipmi_Chassis.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_Chassis.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_Chassis.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_Chassis.c
$(BUILD)/obj/libipmi_fru.o: \
    src/libipmi/src/libipmi_fru.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_fru.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_fru.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_fru.c
$(BUILD)/obj/libipmi_PEF.o: \
    src/libipmi/src/libipmi_PEF.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_PEF.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_PEF.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_PEF.c
$(BUILD)/obj/libipmi_sdr.o: \
    src/libipmi/src/libipmi_sdr.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_sdr.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_sdr.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_sdr.c
$(BUILD)/obj/libipmi_sensor.o: \
    src/libipmi/src/libipmi_sensor.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_sensor.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_sensor.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_sensor.c
$(BUILD)/obj/libipmi_storlead_OEM.o: \
    src/libipmi/src/libipmi_storlead_OEM.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_storlead_OEM.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_storlead_OEM.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_storlead_OEM.c
$(BUILD)/obj/sensor_helpers.o: \
    src/libipmi/src/sensor_helpers.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/sensor_helpers.o'
	$(CC) -c -o $(BUILD)/obj/sensor_helpers.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/sensor_helpers.c
$(BUILD)/obj/libipmi_StorDevice.o: \
    src/libipmi/src/libipmi_StorDevice.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_StorDevice.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_StorDevice.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_StorDevice.c
$(BUILD)/obj/libipmi_usermgmt.o: \
    src/libipmi/src/libipmi_usermgmt.c $(DEPS_USER_C2)
	@echo '   [Compile] $(BUILD)/obj/libipmi_usermgmt.o'
	$(CC) -c -o $(BUILD)/obj/libipmi_usermgmt.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) \
		-D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" src/libipmi/src/libipmi_usermgmt.c


DEPS_USER_C3 += $(BUILD)/inc/goahead.h
DEPS_USER_C3 += $(BUILD)/inc/ResultUtils.h

$(BUILD)/obj/ResultUtils.o: \
    src/utils/mine/ResultUtils.c $(DEPS_USER_C3)
	@echo '   [Compile] $(BUILD)/obj/ResultUtils.o'
	$(CC) -c -o $(BUILD)/obj/ResultUtils.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" -DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) "-I$(ME_COM_OPENSSL_PATH)/include" src/utils/mine/ResultUtils.c


DEPS_USER_C4 += $(BUILD)/inc/goahead.h
DEPS_USER_C4 += $(BUILD)/inc/config.h
DEPS_USER_C4 += $(BUILD)/inc/dashboard.h
DEPS_USER_C4 += $(BUILD)/inc/fan.h
DEPS_USER_C4 += $(BUILD)/inc/fru.h
DEPS_USER_C4 += $(BUILD)/inc/fw_update.h
DEPS_USER_C4 += $(BUILD)/inc/remote_control.h
DEPS_USER_C4 += $(BUILD)/inc/sel.h
DEPS_USER_C4 += $(BUILD)/inc/server_health.h
DEPS_USER_C4 += $(BUILD)/inc/user.h
DEPS_USER_C4 += $(DEPS_USER_C2)

$(BUILD)/obj/config.o: \
    src/web_interface/src/config.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/config.o'
	$(CC) -c -o $(BUILD)/obj/config.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/config.c
$(BUILD)/obj/dashboard.o: \
    src/web_interface/src/dashboard.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/dashboard.o'
	$(CC) -c -o $(BUILD)/obj/dashboard.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/dashboard.c
$(BUILD)/obj/fan.o: \
    src/web_interface/src/fan.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/fan.o'
	$(CC) -c -o $(BUILD)/obj/fan.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/fan.c
$(BUILD)/obj/fru.o: \
    src/web_interface/src/fru.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/fru.o'
	$(CC) -c -o $(BUILD)/obj/fru.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/fru.c
$(BUILD)/obj/fw_update.o: \
    src/web_interface/src/fw_update.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/fw_update.o'
	$(CC) -c -o $(BUILD)/obj/fw_update.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/fw_update.c
$(BUILD)/obj/remote_control.o: \
    src/web_interface/src/remote_control.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/remote_control.o'
	$(CC) -c -o $(BUILD)/obj/remote_control.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/remote_control.c
$(BUILD)/obj/sel.o: \
    src/web_interface/src/sel.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/sel.o'
	$(CC) -c -o $(BUILD)/obj/sel.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/sel.c
$(BUILD)/obj/server_health.o: \
    src/web_interface/src/server_health.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/server_health.o'
	$(CC) -c -o $(BUILD)/obj/server_health.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/server_health.c
$(BUILD)/obj/user.o: \
    src/web_interface/src/user.c $(DEPS_USER_C4)
	@echo '   [Compile] $(BUILD)/obj/user.o'
	$(CC) -c -o $(BUILD)/obj/user.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 \
		-D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" \
		-DME_COM_OPENSSL_PATH=$(ME_COM_OPENSSL_PATH) $(IFLAGS) \
		"-I$(ME_COM_OPENSSL_PATH)/include" \
		src/web_interface/src/user.c

#################### jimbo modify end ###########################













#
#   action.o
#
DEPS_7 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/action.o: \
    src/action.c $(DEPS_7)
	@echo '   [Compile] $(BUILD)/obj/action.o'
	$(CC) -c -o $(BUILD)/obj/action.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/action.c

#
#   alloc.o
#
DEPS_8 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/alloc.o: \
    src/alloc.c $(DEPS_8)
	@echo '   [Compile] $(BUILD)/obj/alloc.o'
	$(CC) -c -o $(BUILD)/obj/alloc.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/alloc.c

#
#   auth.o
#
DEPS_9 += $(BUILD)/inc/goahead.h
DEPS_9 += $(BUILD)/inc/user.h

$(BUILD)/obj/auth.o: \
    src/auth.c $(DEPS_9)
	@echo '   [Compile] $(BUILD)/obj/auth.o'
	$(CC) -c -o $(BUILD)/obj/auth.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/auth.c

#
#   cgi.o
#
DEPS_10 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/cgi.o: \
    src/cgi.c $(DEPS_10)
	@echo '   [Compile] $(BUILD)/obj/cgi.o'
	$(CC) -c -o $(BUILD)/obj/cgi.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/cgi.c

#
#   cgitest.o
#

$(BUILD)/obj/cgitest.o: \
    test/cgitest.c $(DEPS_11)
	@echo '   [Compile] $(BUILD)/obj/cgitest.o'
	$(CC) -c -o $(BUILD)/obj/cgitest.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) $(IFLAGS) test/cgitest.c

#
#   crypt.o
#
DEPS_12 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/crypt.o: \
    src/crypt.c $(DEPS_12)
	@echo '   [Compile] $(BUILD)/obj/crypt.o'
	$(CC) -c -o $(BUILD)/obj/crypt.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/crypt.c

#
#   file.o
#
DEPS_13 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/file.o: \
    src/file.c $(DEPS_13)
	@echo '   [Compile] $(BUILD)/obj/file.o'
	$(CC) -c -o $(BUILD)/obj/file.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/file.c

#
#   fs.o
#
DEPS_14 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/fs.o: \
    src/fs.c $(DEPS_14)
	@echo '   [Compile] $(BUILD)/obj/fs.o'
	$(CC) -c -o $(BUILD)/obj/fs.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/fs.c

#
#   goahead-mbedtls.o
#
DEPS_15 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/goahead-mbedtls.o: \
    src/goahead-mbedtls/goahead-mbedtls.c $(DEPS_15)
	@echo '   [Compile] $(BUILD)/obj/goahead-mbedtls.o'
	$(CC) -c -o $(BUILD)/obj/goahead-mbedtls.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/goahead-mbedtls/goahead-mbedtls.c

#
#   goahead-openssl.o
#
DEPS_16 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/goahead-openssl.o: \
    src/goahead-openssl/goahead-openssl.c $(DEPS_16)
	@echo '   [Compile] $(BUILD)/obj/goahead-openssl.o'
	$(CC) -c -o $(BUILD)/obj/goahead-openssl.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) $(IFLAGS) src/goahead-openssl/goahead-openssl.c

#
#   goahead.o
#
DEPS_17 += $(BUILD)/inc/goahead.h
DEPS_17 += $(BUILD)/inc/com_BmcType.h

$(BUILD)/obj/goahead.o: \
    src/goahead.c $(DEPS_17)
	@echo '   [Compile] $(BUILD)/obj/goahead.o'
	$(CC) -c -o $(BUILD)/obj/goahead.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/goahead.c

#
#   gopass.o
#
DEPS_18 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/gopass.o: \
    src/utils/gopass.c $(DEPS_18)
	@echo '   [Compile] $(BUILD)/obj/gopass.o'
	$(CC) -c -o $(BUILD)/obj/gopass.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/utils/gopass.c

#
#   http.o
#
DEPS_19 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/http.o: \
    src/http.c $(DEPS_19)
	@echo '   [Compile] $(BUILD)/obj/http.o'
	$(CC) -c -o $(BUILD)/obj/http.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/http.c

#
#   js.o
#
DEPS_20 += $(BUILD)/inc/js.h

$(BUILD)/obj/js.o: \
    src/js.c $(DEPS_20)
	@echo '   [Compile] $(BUILD)/obj/js.o'
	$(CC) -c -o $(BUILD)/obj/js.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/js.c

#
#   jst.o
#
DEPS_21 += $(BUILD)/inc/goahead.h
DEPS_21 += $(BUILD)/inc/js.h

$(BUILD)/obj/jst.o: \
    src/jst.c $(DEPS_21)
	@echo '   [Compile] $(BUILD)/obj/jst.o'
	$(CC) -c -o $(BUILD)/obj/jst.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/jst.c

#
#   mbedtls.h
#

src/mbedtls/mbedtls.h: $(DEPS_22)

#
#   mbedtls.o
#
DEPS_23 += src/mbedtls/mbedtls.h

$(BUILD)/obj/mbedtls.o: \
    src/mbedtls/mbedtls.c $(DEPS_23)
	@echo '   [Compile] $(BUILD)/obj/mbedtls.o'
	$(CC) -c -o $(BUILD)/obj/mbedtls.o $(LDFLAGS) $(CFLAGS) -Wno-format-zero-length $(DFLAGS) -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/mbedtls/mbedtls.c

#
#   options.o
#
DEPS_24 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/options.o: \
    src/options.c $(DEPS_24)
	@echo '   [Compile] $(BUILD)/obj/options.o'
	$(CC) -c -o $(BUILD)/obj/options.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/options.c

#
#   osdep.o
#
DEPS_25 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/osdep.o: \
    src/osdep.c $(DEPS_25)
	@echo '   [Compile] $(BUILD)/obj/osdep.o'
	$(CC) -c -o $(BUILD)/obj/osdep.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/osdep.c

#
#   rom.o
#
DEPS_26 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/rom.o: \
    src/rom.c $(DEPS_26)
	@echo '   [Compile] $(BUILD)/obj/rom.o'
	$(CC) -c -o $(BUILD)/obj/rom.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/rom.c

#
#   route.o
#
DEPS_27 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/route.o: \
    src/route.c $(DEPS_27)
	@echo '   [Compile] $(BUILD)/obj/route.o'
	$(CC) -c -o $(BUILD)/obj/route.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/route.c

#
#   runtime.o
#
DEPS_28 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/runtime.o: \
    src/runtime.c $(DEPS_28)
	@echo '   [Compile] $(BUILD)/obj/runtime.o'
	$(CC) -c -o $(BUILD)/obj/runtime.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/runtime.c

#
#   socket.o
#
DEPS_29 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/socket.o: \
    src/socket.c $(DEPS_29)
	@echo '   [Compile] $(BUILD)/obj/socket.o'
	$(CC) -c -o $(BUILD)/obj/socket.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/socket.c

#
#   test.o
#
DEPS_30 += $(BUILD)/inc/goahead.h
DEPS_30 += $(BUILD)/inc/js.h

$(BUILD)/obj/test.o: \
    test/test.c $(DEPS_30)
	@echo '   [Compile] $(BUILD)/obj/test.o'
	$(CC) -c -o $(BUILD)/obj/test.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) test/test.c

#
#   time.o
#
DEPS_31 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/time.o: \
    src/time.c $(DEPS_31)
	@echo '   [Compile] $(BUILD)/obj/time.o'
	$(CC) -c -o $(BUILD)/obj/time.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/time.c

#
#   upload.o
#
DEPS_32 += $(BUILD)/inc/goahead.h

$(BUILD)/obj/upload.o: \
    src/upload.c $(DEPS_32)
	@echo '   [Compile] $(BUILD)/obj/upload.o'
	$(CC) -c -o $(BUILD)/obj/upload.o $(LDFLAGS) $(CFLAGS) $(DFLAGS) -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -DMBEDTLS_USER_CONFIG_FILE=\"embedtls.h\" $(IFLAGS) src/upload.c

ifeq ($(ME_COM_MBEDTLS),1)
#
#   libmbedtls
#
DEPS_33 += $(BUILD)/inc/osdep.h
DEPS_33 += $(BUILD)/inc/embedtls.h
DEPS_33 += $(BUILD)/inc/mbedtls.h
DEPS_33 += $(BUILD)/obj/mbedtls.o

$(BUILD)/bin/libmbedtls.a: $(DEPS_33)
	@echo '      [Link] $(BUILD)/bin/libmbedtls.a'
	$(AR) -cr $(BUILD)/bin/libmbedtls.a "$(BUILD)/obj/mbedtls.o"
endif

ifeq ($(ME_COM_MBEDTLS),1)
#
#   libgoahead-mbedtls
#
DEPS_34 += $(BUILD)/bin/libmbedtls.a
DEPS_34 += $(BUILD)/obj/goahead-mbedtls.o

$(BUILD)/bin/libgoahead-mbedtls.a: $(DEPS_34)
	@echo '      [Link] $(BUILD)/bin/libgoahead-mbedtls.a'
	$(AR) -cr $(BUILD)/bin/libgoahead-mbedtls.a "$(BUILD)/obj/goahead-mbedtls.o"
endif

ifeq ($(ME_COM_OPENSSL),1)
#
#   libgoahead-openssl
#
DEPS_35 += $(BUILD)/obj/goahead-openssl.o

$(BUILD)/bin/libgoahead-openssl.a: $(DEPS_35)
	@echo '      [Link] $(BUILD)/bin/libgoahead-openssl.a'
	$(AR) -cr $(BUILD)/bin/libgoahead-openssl.a "$(BUILD)/obj/goahead-openssl.o"
endif

#
#   libgo
#
DEPS_36 += $(BUILD)/inc/osdep.h
ifeq ($(ME_COM_MBEDTLS),1)
    DEPS_36 += $(BUILD)/bin/libgoahead-mbedtls.a
endif
ifeq ($(ME_COM_OPENSSL),1)
    DEPS_36 += $(BUILD)/bin/libgoahead-openssl.a
endif
DEPS_36 += $(BUILD)/inc/goahead.h
DEPS_36 += $(BUILD)/inc/js.h
DEPS_36 += $(BUILD)/obj/action.o
DEPS_36 += $(BUILD)/obj/alloc.o
DEPS_36 += $(BUILD)/obj/auth.o
DEPS_36 += $(BUILD)/obj/cgi.o
DEPS_36 += $(BUILD)/obj/crypt.o
DEPS_36 += $(BUILD)/obj/file.o
DEPS_36 += $(BUILD)/obj/fs.o
DEPS_36 += $(BUILD)/obj/http.o
DEPS_36 += $(BUILD)/obj/js.o
DEPS_36 += $(BUILD)/obj/jst.o
DEPS_36 += $(BUILD)/obj/options.o
DEPS_36 += $(BUILD)/obj/osdep.o
DEPS_36 += $(BUILD)/obj/rom.o
DEPS_36 += $(BUILD)/obj/route.o
DEPS_36 += $(BUILD)/obj/runtime.o
DEPS_36 += $(BUILD)/obj/socket.o
DEPS_36 += $(BUILD)/obj/time.o
DEPS_36 += $(BUILD)/obj/upload.o
################ jimbo add #######################
## cJSON
DEPS_36 += $(BUILD)/obj/cJSON.o

## libipmi
DEPS_36 += $(BUILD)/obj/libipmi_session.o
DEPS_36 += $(BUILD)/obj/libipmi_uds_session.o
DEPS_36 += $(BUILD)/obj/libipmi_IPM.o
DEPS_36 += $(BUILD)/obj/libipmi_Chassis.o
DEPS_36 += $(BUILD)/obj/libipmi_fru.o
DEPS_36 += $(BUILD)/obj/libipmi_PEF.o
DEPS_36 += $(BUILD)/obj/libipmi_sdr.o
DEPS_36 += $(BUILD)/obj/libipmi_sensor.o
DEPS_36 += $(BUILD)/obj/libipmi_storlead_OEM.o
DEPS_36 += $(BUILD)/obj/sensor_helpers.o
DEPS_36 += $(BUILD)/obj/libipmi_StorDevice.o
DEPS_36 += $(BUILD)/obj/libipmi_usermgmt.o

## resultUtils
DEPS_36 += $(BUILD)/obj/ResultUtils.o

## web interface
DEPS_36 += $(BUILD)/obj/config.o
DEPS_36 += $(BUILD)/obj/dashboard.o
DEPS_36 += $(BUILD)/obj/fan.o
DEPS_36 += $(BUILD)/obj/fru.o
DEPS_36 += $(BUILD)/obj/fw_update.o
DEPS_36 += $(BUILD)/obj/remote_control.o
DEPS_36 += $(BUILD)/obj/sel.o
DEPS_36 += $(BUILD)/obj/server_health.o
DEPS_36 += $(BUILD)/obj/user.o

################ jimbo add end ###################
$(BUILD)/bin/libgo.a: $(DEPS_36)
	@echo '      [Link] $(BUILD)/bin/libgo.a'
	$(AR) -cr $(BUILD)/bin/libgo.a "$(BUILD)/obj/action.o" "$(BUILD)/obj/alloc.o" "$(BUILD)/obj/auth.o" "$(BUILD)/obj/cgi.o" "$(BUILD)/obj/crypt.o" "$(BUILD)/obj/file.o" "$(BUILD)/obj/fs.o" "$(BUILD)/obj/http.o" "$(BUILD)/obj/js.o" "$(BUILD)/obj/jst.o" "$(BUILD)/obj/options.o" "$(BUILD)/obj/osdep.o" "$(BUILD)/obj/rom.o" "$(BUILD)/obj/route.o" "$(BUILD)/obj/runtime.o" "$(BUILD)/obj/socket.o" "$(BUILD)/obj/time.o" "$(BUILD)/obj/upload.o"\
		"$(BUILD)/obj/cJSON.o" "$(BUILD)/obj/libipmi_session.o" \
		"$(BUILD)/obj/libipmi_uds_session.o" "$(BUILD)/obj/libipmi_IPM.o" "$(BUILD)/obj/libipmi_fru.o" \
		"$(BUILD)/obj/libipmi_Chassis.o" "$(BUILD)/obj/libipmi_PEF.o" "$(BUILD)/obj/libipmi_sdr.o" \
		"$(BUILD)/obj/libipmi_sensor.o" "$(BUILD)/obj/libipmi_storlead_OEM.o" "$(BUILD)/obj/sensor_helpers.o"  \
		"$(BUILD)/obj/libipmi_StorDevice.o" "$(BUILD)/obj/libipmi_usermgmt.o"  \
		"$(BUILD)/obj/config.o" "$(BUILD)/obj/dashboard.o" "$(BUILD)/obj/fan.o" "$(BUILD)/obj/fru.o" \
		"$(BUILD)/obj/fw_update.o" "$(BUILD)/obj/remote_control.o" "$(BUILD)/obj/sel.o" \
		"$(BUILD)/obj/server_health.o" "$(BUILD)/obj/user.o" 

#
#   install-certs
#
DEPS_37 += src/certs/samples/ca.crt
DEPS_37 += src/certs/samples/ca.key
DEPS_37 += src/certs/samples/ec.crt
DEPS_37 += src/certs/samples/ec.key
DEPS_37 += src/certs/samples/roots.crt
DEPS_37 += src/certs/samples/self.crt
DEPS_37 += src/certs/samples/self.key
DEPS_37 += src/certs/samples/test.crt
DEPS_37 += src/certs/samples/test.key

$(BUILD)/.install-certs-modified: $(DEPS_37)
	@echo '      [Copy] $(BUILD)/bin'
	mkdir -p "$(BUILD)/bin"
	cp src/certs/samples/ca.crt $(BUILD)/bin/ca.crt
	cp src/certs/samples/ca.key $(BUILD)/bin/ca.key
	cp src/certs/samples/ec.crt $(BUILD)/bin/ec.crt
	cp src/certs/samples/ec.key $(BUILD)/bin/ec.key
	cp src/certs/samples/roots.crt $(BUILD)/bin/roots.crt
	cp src/certs/samples/self.crt $(BUILD)/bin/self.crt
	cp src/certs/samples/self.key $(BUILD)/bin/self.key
	cp src/certs/samples/test.crt $(BUILD)/bin/test.crt
	cp src/certs/samples/test.key $(BUILD)/bin/test.key
	touch "$(BUILD)/.install-certs-modified"

#
#   goahead
#
DEPS_38 += $(BUILD)/bin/libgo.a
DEPS_38 += $(BUILD)/.install-certs-modified
DEPS_38 += $(BUILD)/inc/goahead.h
DEPS_38 += $(BUILD)/inc/js.h
DEPS_38 += $(BUILD)/obj/goahead.o

ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_38 += -lmbedtls
endif
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_38 += -lgoahead-mbedtls
endif
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_38 += -lmbedtls
endif
ifeq ($(ME_COM_OPENSSL),1)
    LIBS_38 += -lgoahead-openssl
endif
LIBS_38 += -lgo
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_38 += -lgoahead-mbedtls
endif

$(BUILD)/bin/goahead: $(DEPS_38)
	@echo '      [Link] $(BUILD)/bin/goahead'
	$(CC) -o $(BUILD)/bin/goahead $(LDFLAGS) $(LIBPATHS) "$(BUILD)/obj/goahead.o" $(LIBPATHS_38) $(LIBS_38) $(LIBS_38) $(LIBS) $(LIBS) 

#
#   goahead-test
#
#DEPS_39 += $(BUILD)/bin/libgo.a
#DEPS_39 += $(BUILD)/.install-certs-modified
#DEPS_39 += $(BUILD)/obj/test.o
#
#ifeq ($(ME_COM_MBEDTLS),1)
#    LIBS_39 += -lmbedtls
#endif
#ifeq ($(ME_COM_MBEDTLS),1)
#    LIBS_39 += -lgoahead-mbedtls
#endif
#ifeq ($(ME_COM_MBEDTLS),1)
#    LIBS_39 += -lmbedtls
#endif
#ifeq ($(ME_COM_OPENSSL),1)
#    LIBS_39 += -lgoahead-openssl
#endif
#LIBS_39 += -lgo
#ifeq ($(ME_COM_MBEDTLS),1)
#    LIBS_39 += -lgoahead-mbedtls
#endif
#
#$(BUILD)/bin/goahead-test: $(DEPS_39)
#	@echo '      [Link] $(BUILD)/bin/goahead-test'
#	$(CC) -o $(BUILD)/bin/goahead-test $(LDFLAGS) $(LIBPATHS) "$(BUILD)/obj/test.o" $(LIBPATHS_39) $(LIBS_39) $(LIBS_39) $(LIBS) $(LIBS) 

#
#   gopass
#
DEPS_40 += $(BUILD)/bin/libgo.a
DEPS_40 += $(BUILD)/inc/goahead.h
DEPS_40 += $(BUILD)/inc/js.h
DEPS_40 += $(BUILD)/obj/gopass.o

ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_40 += -lmbedtls
endif
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_40 += -lgoahead-mbedtls
endif
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_40 += -lmbedtls
endif
ifeq ($(ME_COM_OPENSSL),1)
    LIBS_40 += -lgoahead-openssl
endif
LIBS_40 += -lgo
ifeq ($(ME_COM_MBEDTLS),1)
    LIBS_40 += -lgoahead-mbedtls
endif

$(BUILD)/bin/gopass: $(DEPS_40)
	@echo '      [Link] $(BUILD)/bin/gopass'
	$(CC) -o $(BUILD)/bin/gopass $(LDFLAGS) $(LIBPATHS) "$(BUILD)/obj/gopass.o" $(LIBPATHS_40) $(LIBS_40) $(LIBS_40) $(LIBS) $(LIBS) 

#
#   stop
#
#
#stop: $(DEPS_41)
#
#
#   installBinary
#
#
#installBinary: $(DEPS_42)
#	mkdir -p "$(ME_APP_PREFIX)" ; \
#	rm -f "$(ME_APP_PREFIX)/latest" ; \
#	ln -s "$(VERSION)" "$(ME_APP_PREFIX)/latest" ; \
##	mkdir -p "$(ME_MAN_PREFIX)/man1" ; \
#	chmod 755 "$(ME_MAN_PREFIX)/man1" ; \
#	mkdir -p "$(ME_VAPP_PREFIX)/bin" ; \
#	cp $(BUILD)/bin/goahead $(ME_VAPP_PREFIX)/bin/goahead ; \
#	chmod 755 "$(ME_VAPP_PREFIX)/bin/goahead" ; \
#	mkdir -p "$(ME_BIN_PREFIX)" ; \
#	rm -f "$(ME_BIN_PREFIX)/goahead" ; \
#	ln -s "$(ME_VAPP_PREFIX)/bin/goahead" "$(ME_BIN_PREFIX)/goahead" ; \
#	mkdir -p "$(ME_VAPP_PREFIX)/bin" ; \
#	cp $(BUILD)/bin/roots.crt $(ME_VAPP_PREFIX)/bin/roots.crt ; \
#	mkdir -p "$(ME_WEB_PREFIX)" ; \
#	cp src/web/index.html $(ME_WEB_PREFIX)/index.html ; \
#	cp src/web/favicon.ico $(ME_WEB_PREFIX)/favicon.ico ; \
#	mkdir -p "$(ME_ETC_PREFIX)" ; \
#	cp src/auth.txt $(ME_ETC_PREFIX)/auth.txt ; \
#	cp src/route.txt $(ME_ETC_PREFIX)/route.txt ; \
#	mkdir -p "$(ME_VAPP_PREFIX)/doc/man/man1" ; \
#	cp doc/dist/man/goahead.1 $(ME_VAPP_PREFIX)/doc/man/man1/goahead.1 ; \
#	mkdir -p "$(ME_MAN_PREFIX)/man1" ; \
#	rm -f "$(ME_MAN_PREFIX)/man1/goahead.1" ; \
#	ln -s "$(ME_VAPP_PREFIX)/doc/man/man1/goahead.1" "$(ME_MAN_PREFIX)/man1/goahead.1" ; \
#	cp doc/dist/man/gopass.1 $(ME_VAPP_PREFIX)/doc/man/man1/gopass.1 ; \
#	mkdir -p "$(ME_MAN_PREFIX)/man1" ; \
#	rm -f "$(ME_MAN_PREFIX)/man1/gopass.1" ; \
#	ln -s "$(ME_VAPP_PREFIX)/doc/man/man1/gopass.1" "$(ME_MAN_PREFIX)/man1/gopass.1" ; \
#	cp doc/dist/man/webcomp.1 $(ME_VAPP_PREFIX)/doc/man/man1/webcomp.1 ; \
#	mkdir -p "$(ME_MAN_PREFIX)/man1" ; \
#	rm -f "$(ME_MAN_PREFIX)/man1/webcomp.1" ; \
#	ln -s "$(ME_VAPP_PREFIX)/doc/man/man1/webcomp.1" "$(ME_MAN_PREFIX)/man1/webcomp.1"

#
#   start
#

#start: $(DEPS_43)

#
#   install
#
#DEPS_44 += stop
#DEPS_44 += installBinary
#DEPS_44 += start

#install: $(DEPS_44)

#
#   installPrep
#

#installPrep: $(DEPS_45)
#	if [ "`id -u`" != 0 ] ; \
#	then echo "Must run as root. Rerun with sudo." ; \
#	exit 255 ; \
#	fi

#
#   uninstall
#
#DEPS_46 += stop

#uninstall: $(DEPS_46)

#
#   uninstallBinary
#

#uninstallBinary: $(DEPS_47)
#	rm -fr "$(ME_WEB_PREFIX)" ; \
#	rm -fr "$(ME_VAPP_PREFIX)" ; \
#	rmdir -p "$(ME_ETC_PREFIX)" 2>/dev/null ; true ; \
#	rmdir -p "$(ME_WEB_PREFIX)" 2>/dev/null ; true ; \
#	rm -f "$(ME_APP_PREFIX)/latest" ; \
#	rmdir -p "$(ME_APP_PREFIX)" 2>/dev/null ; true

#
#   version
#

version: $(DEPS_48)
	echo $(VERSION)

