代码拉取完成,页面将自动刷新
同步操作将从 gozfree/gear-lib 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
###############################################################################
# common
###############################################################################
#ARCH: linux/arm/android/ios/win
ARCH ?= linux
CROSS_PREFIX ?=
OUTPUT ?= /usr/local
BUILD_DIR := $(shell pwd)/../build/
ARCH_INC := $(BUILD_DIR)/$(ARCH).inc
COLOR_INC := $(BUILD_DIR)/color.inc
ifeq ($(ARCH_INC), $(wildcard $(ARCH_INC)))
include $(ARCH_INC)
endif
CC = $(CROSS_PREFIX)gcc
CXX = $(CROSS_PREFIX)g++
LD = $(CROSS_PREFIX)ld
AR = $(CROSS_PREFIX)ar
STRIP = $(CROSS_PREFIX)strip
ifeq ($(COLOR_INC), $(wildcard $(COLOR_INC)))
include $(COLOR_INC)
else
CC_V = $(CC)
CXX_V = $(CXX)
LD_V = $(LD)
AR_V = $(AR)
CP_V = $(CP)
RM_V = $(RM)
endif
###############################################################################
# target and object
###############################################################################
LIBNAME = libgear
VERSION_SH = $(shell pwd)/src/version.sh $(LIBNAME)
VER = $(shell $(VERSION_SH); awk '/define\ $(LIBNAME)_version/{print $$3}' version.h)
TGT_LIB_H = $(LIBNAME).h
TGT_LIB_A = $(LIBNAME).a
TGT_LIB_SO = $(LIBNAME).so
TGT_LIB_SO_VER = $(TGT_LIB_SO).${VER}
OBJS_LIB := $(patsubst %.c,%.o,$(wildcard src/*.c))
###############################################################################
# cflags and ldflags
###############################################################################
ifeq ($(MODE), release)
CFLAGS := -O2 -Wall -Werror -fPIC
LTYPE := release
else
CFLAGS := -g -Wall -Werror -fPIC
LTYPE := debug
endif
ifeq ($(OUTPUT),/usr/local)
OUTLIBPATH := /usr/local
else
OUTLIBPATH := $(OUTPUT)/$(LTYPE)
endif
CFLAGS += $($(ARCH)_CFLAGS)
CFLAGS += -I./include
CFLAGS += -I$(OUTPUT)/include
CFLAGS += -DNO_CRYPTO
SHARED := -shared
LDFLAGS := $($(ARCH)_LDFLAGS)
LDFLAGS += -pthread
###############################################################################
# target
###############################################################################
.PHONY : all clean
TGT := $(TGT_LIB_A)
TGT += $(TGT_LIB_SO)
OBJS := $(OBJS_LIB)
all: $(TGT)
%.o:%.c
$(CC_V) -c $(CFLAGS) $< -o $@
$(TGT_LIB_A): $(OBJS_LIB)
$(AR_V) rcs $@ $^
$(TGT_LIB_SO): $(OBJS_LIB)
$(CC_V) -o $@ $^ $(SHARED)
@mv $(TGT_LIB_SO) $(TGT_LIB_SO_VER)
@ln -sf $(TGT_LIB_SO_VER) $(TGT_LIB_SO)
clean:
$(RM_V) -f $(OBJS)
$(RM_V) -f $(TGT)
$(RM_V) -f version.h
$(RM_V) -f $(TGT_LIB_SO)*
$(RM_V) -f $(TGT_LIB_SO_VER)
install:
$(MAKEDIR_OUTPUT)
@if [ "$(MODE)" = "release" ];then $(STRIP) $(TGT); fi
@mkdir -p ${OUTPUT}/include/gear-lib
@mkdir -p ${OUTPUT}/lib/gear-lib
$(CP_V) -r include/$(TGT_LIB_H) $(OUTPUT)/include/gear-lib
$(CP_V) -r $(TGT_LIB_A) $(OUTLIBPATH)/lib/gear-lib
$(CP_V) -r $(TGT_LIB_SO) $(OUTLIBPATH)/lib/gear-lib
$(CP_V) -r $(TGT_LIB_SO_VER) $(OUTLIBPATH)/lib/gear-lib
uninstall:
cd $(OUTPUT)/include/gear-lib && rm -f $(TGT_LIB_H)
$(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_A)
$(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_SO)
$(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_SO_VER)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。