diff options
Diffstat (limited to '')
-rw-r--r-- | addons/deviceatlas/Makefile | 48 | ||||
-rw-r--r-- | addons/deviceatlas/Makefile.inc | 31 |
2 files changed, 31 insertions, 48 deletions
diff --git a/addons/deviceatlas/Makefile b/addons/deviceatlas/Makefile deleted file mode 100644 index fbcffca..0000000 --- a/addons/deviceatlas/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# DEVICEATLAS_SRC : DeviceAtlas API source root path - - -OS := $(shell uname -s) -OBJS := dadwsch.o -CFLAGS := -g -O2 -LDFLAGS := - -CURL_CONFIG := curl-config -CURLDIR := $(shell $(CURL_CONFIG) --prefix 2>/dev/null || echo /usr/local) -CURL_INC := $(CURLDIR)/include -CURL_LIB := $(CURLDIR)/lib -CURL_LDFLAGS := $(shell $(CURL_CONFIG) --libs 2>/dev/null || echo -L /usr/local/lib -lcurl) - -PCRE2_CONFIG := pcre2-config -PCRE2DIR := $(shell $(PCRE2_CONFIG) --prefix 2>/dev/null || echo /usr/local) -PCRE2_INC := $(PCRE2DIR)/include -PCRE2_LIB := $(PCRE2DIR)/lib -PCRE2_LDFLAGS := $(shell $(PCRE2_CONFIG) --libs8 2>/dev/null || echo /usr/local) - -ifeq ($(DEVICEATLAS_SRC),) -dadwsch: dadwsch.c - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -LDFLAGS += -lda -else -DEVICEATLAS_INC = $(DEVICEATLAS_SRC) -DEVICEATLAS_LIB = $(DEVICEATLAS_SRC) -CFLAGS += -DDA_REGEX_HDR=\"dac_pcre2.c\" -DDA_REGEX_TAG=2 -CFLAGS += -DMOBI_CURL -DMOBI_CURLSSET -DMOBI_GZ -DMOBI_ZIP -CFLAGS += -I$(DEVICEATLAS_INC) -I$(CURL_INC) -I$(PCRE2DIR) -LDFLAGS += $(CURL_LDFLAGS) $(PCRE2_LDFLAGS) -lz -lzip -lpthread - -dadwsch: dadwsch.c $(DEVICEATLAS_SRC)/dac.c $(DEVICEATLAS_SRC)/dasch.c $(DEVICEATLAS_SRC)/dadwarc.c $(DEVICEATLAS_SRC)/dadwcom.c $(DEVICEATLAS_SRC)/dadwcurl.c $(DEVICEATLAS_SRC)/json.c $(DEVICEATLAS_SRC)/Os/daunix.c - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -endif - -ifeq ($(OS), Linux) -LDFLAGS += -lrt -endif -ifeq ($(OS), SunOS) -LDFLAGS += -lrt -endif - -clean: - rm -f *.o - rm -f $(DEVICEATLAS_LIB)*.o - rm -f dadwsch diff --git a/addons/deviceatlas/Makefile.inc b/addons/deviceatlas/Makefile.inc new file mode 100644 index 0000000..07d950a --- /dev/null +++ b/addons/deviceatlas/Makefile.inc @@ -0,0 +1,31 @@ +# DEVICEATLAS_SRC : DeviceAtlas API source root path + + +CXX := c++ +CXXLIB := -lstdc++ + +ifeq ($(DEVICEATLAS_SRC),) +OPTIONS_LDFLAGS += -lda +else +DEVICEATLAS_INC = $(DEVICEATLAS_SRC) +DEVICEATLAS_LIB = $(DEVICEATLAS_SRC) +OPTIONS_LDFLAGS += -lpthread +OPTIONS_CFLAGS += -I$(DEVICEATLAS_INC) +ifeq ($(DEVICEATLAS_NOCACHE),) +CXXFLAGS := $(OPTIONS_CFLAGS) -std=gnu++11 +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dacache.o +OPTIONS_LDFLAGS += $(CXXLIB) +else +OPTIONS_CFLAGS += -DAPINOCACHE +endif +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dac.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/json.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dasch.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dadwarc.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dadwcom.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/dadwcurl.o +OPTIONS_OBJS += $(DEVICEATLAS_SRC)/Os/daunix.o +endif + +addons/deviceatlas/dummy/%.o: addons/deviceatlas/dummy/%.cpp + $(cmd_CXX) $(CXXFLAGS) -c -o $@ $< |