diff --git a/Makefile b/Makefile index fec7452..01412c6 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ PKG_CONFIG_DEPENDS:= \ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +CWMP_REVISION:=$(shell svnversion $(PWD) -n|cut -f2 -d:) + include $(INCLUDE_DIR)/package.mk define Package/cwmp/Default @@ -60,6 +62,13 @@ endif TARGET_CFLAGS += \ -D_GNU_SOURCE + +ifneq ($(CWMP_REVISION)_,_) +ifneq ($(CWMP_REVISION),exported) +TARGET_CFLAGS += -DCWMP_REVISION=\"$(CWMP_REVISION)\" +TARGET_LDFLAGS += -DCWMP_REVISION=\"$(CWMP_REVISION)\" +endif +endif TARGET_LDFLAGS += \ -Wl,-rpath-link=$(STAGING_DIR)/usr/lib diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index e9732a8..b4ddfd1 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -45,8 +45,6 @@ cwmpd_LDADD = \ $(LIBZSTREAM_LIBS) \ $(LIBPTHREAD_LIBS) -CWMP_REVISION=$(shell svnversion $(PWD) -n|cut -f2 -d:) - cwmpd_CFLAGS+=-DCWMP_VERSION=\"$(CWMP_VERSION)\" cwmpd_LDFLAGS+=-DCWMP_VERSION=\"$(CWMP_VERSION)\"