Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

82 lines (58 sloc) 2.125 kb
#.SILENT:
# Sufix and prefix
ARCH := $(shell getconf LONG_BIT)
LIBSUFFIX=a
LIBPREFIX=lib
SOURCE_SUFIX := cc
SOURCE_FILES := $(wildcard *.$(SOURCE_SUFIX))
RFLIBS := $(addprefix $(BUILD_LIB_DIR)/,$(RFLIB_NAME))
RFLIBS := $(addsuffix .$(LIBSUFFIX),$(RFLIBS))
LNX_LIBS := -lrt -lnetlink -lutil -lpthread -lmongoclient -lboost_thread -lboost_system -lboost_filesystem -lboost_program_options
CPPFLAGS += -I$(LIB_DIR)
CPPFLAGS += $(addprefix -I$(LIB_DIR)/,$(libdirs))
CPPFLAGS += -I$(MONGO_DIR)
ifneq (,$(DEBUG))
CFLAGS += -g -D_GLIBCXX_DEBUG=1
endif
ifneq (,$(MAKEAPPS))
apps_bin := $(BUILD_DIR)/$(MAKEAPPS)
objs := $(patsubst %.$(SOURCE_SUFIX),%.o, \
$(addprefix $(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/,$(SOURCE_FILES)))
endif
ifneq (,$(MAKELIBS))
targetlib := $(BUILD_LIB_DIR)/$(RFLIB_NAME).$(LIBSUFFIX)
objs := $(foreach dir, $(MAKELIBS), $(wildcard $(BUILD_OBJ_DIR)/$(dir)/*.o))
endif
ifneq (,$(LIBDEP))
ifeq ($(ARCH),64)
CPPFLAGS += -fPIC
endif
lib_objs := $(patsubst %.$(SOURCE_SUFIX),%.o, \
$(addprefix $(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/,$(SOURCE_FILES)))
endif
ifneq (,$(SOURCE_FILES))
endif
################################################################################
# TARGETS
all: $(lib_objs) $(targetlib) $(apps_bin)
################################################################################
# BUILD OBJS
$(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/%.o: %.$(SOURCE_SUFIX)
$(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
################################################################################
# BUILD LIB DEPS
$(BUILD_LIB_DIR)/$(notdir $(CURDIR))/%.o: %.$(SOURCE_SUFIX)
$(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
################################################################################
# BUILD LIBS
$(BUILD_LIB_DIR)/%.$(LIBSUFFIX): $(objs)
$(AR) r $@ $?
################################################################################
# BUILD APPS
$(apps_bin): $(objs) $(RFLIBS)
$(CPP) $(CPPFLAGS) -o $@ $(objs) $(RFLIBS) $(LNX_LIBS);
################################################################################
# CLEAN
clean:
@rm -f $(objs);
@rm -f $(targetlib);
Jump to Line
Something went wrong with that request. Please try again.