support aliyun sdk on TencentOS tiny
sample: examples\aliyun_iotkit_csdk_mqtt project: board\TencentOS_tiny_EVB_MX_Plus\KEIL\aliyun_iotkit_csdk_mqtt
This commit is contained in:
70
components/connectivity/iotkit-embedded-3.0.1/3rdparty/tools/misc/makefile.output
vendored
Normal file
70
components/connectivity/iotkit-embedded-3.0.1/3rdparty/tools/misc/makefile.output
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
LIB_SDK_TARGET := libiot_sdk.a
|
||||
LIB_HAL_TARGET := libiot_hal.a
|
||||
|
||||
###############################################################################
|
||||
# Compiler
|
||||
|
||||
CC := gcc
|
||||
AR := ar
|
||||
|
||||
###############################################################################
|
||||
# Path definitions
|
||||
|
||||
TOPDIR := .
|
||||
BLDDIR := build
|
||||
SRCDIR := eng
|
||||
EXPDIR := examples
|
||||
HDRDIR := $(shell find $(SRCDIR) -type d)
|
||||
|
||||
PROG_TARGET := $(shell ls $(EXPDIR) 2>/dev/null|grep example|sed 's:\.c::g;s:_:-:g')
|
||||
PROG_TARGET := $(foreach V,$(PROG_TARGET),$(BLDDIR)/$(V))
|
||||
|
||||
###############################################################################
|
||||
# Application source files
|
||||
|
||||
SOURCE_FILES_C := $(shell find $(SRCDIR) -name "*.c" -not -path "*wrappers*")
|
||||
WRAPPER_IMPL_C := $(shell find $(SRCDIR) -name "*.c" -path "*wrappers*")
|
||||
|
||||
###############################################################################
|
||||
# Standard application lib/header search paths
|
||||
|
||||
CFLAGS := $(addprefix -I,$(HDRDIR))
|
||||
LDFLAGS := -L$(BLDDIR) -liot_sdk -liot_hal -lpthread -lrt
|
||||
|
||||
###############################################################################
|
||||
# Dependency rules
|
||||
|
||||
LIB_OBJS := $(SOURCE_FILES_C:.c=.o)
|
||||
LIB_OBJS := $(subst $(SRCDIR),$(BLDDIR),$(LIB_OBJS))
|
||||
|
||||
HAL_OBJS := $(WRAPPER_IMPL_C:.c=.o)
|
||||
HAL_OBJS := $(subst $(SRCDIR),$(BLDDIR),$(HAL_OBJS))
|
||||
|
||||
.PHONY: prepare all clean prog
|
||||
|
||||
all: prepare $(BLDDIR)/$(LIB_SDK_TARGET) $(BLDDIR)/$(LIB_HAL_TARGET)
|
||||
|
||||
prog: all $(PROG_TARGET)
|
||||
|
||||
prepare:
|
||||
-@mkdir -p $(BLDDIR)
|
||||
|
||||
$(BLDDIR)/$(LIB_SDK_TARGET): $(LIB_OBJS)
|
||||
@echo "o Archiving $@ ..."
|
||||
@$(AR) -rcs $@ $^
|
||||
|
||||
$(BLDDIR)/$(LIB_HAL_TARGET): $(HAL_OBJS)
|
||||
@echo "o Archiving $@ ..."
|
||||
@$(AR) -rcs $@ $^
|
||||
|
||||
$(PROG_TARGET): $(BLDDIR)/$(LIB_SDK_TARGET) $(BLDDIR)/$(LIB_HAL_TARGET)
|
||||
@echo "+ Linking $@ ..."
|
||||
@$(CC) -o $@ $(shell echo $@".c"|sed 's:$(BLDDIR):$(EXPDIR):g;s:-:_:g') $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
$(BLDDIR)/%.o: $(SRCDIR)/%.c
|
||||
@echo ": Compiling $< ..."
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
clean:
|
||||
@rm -rf $(BLDDIR)
|
Reference in New Issue
Block a user