wip: modify rules for launchpad.net build
authorSangjung Woo <sangjung.woo@samsung.com>
Wed, 17 Oct 2018 02:44:01 +0000 (11:44 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Wed, 17 Oct 2018 12:03:18 +0000 (21:03 +0900)
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
debian/rules

index ad93098c24bd350983c590eba23df5f253b0c9ff..e538a3078b3536bd07ff04011476396919620631 100755 (executable)
@@ -1,10 +1,18 @@
 #!/usr/bin/make -f
 
-ARCH := $(shell arch)
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
 CXXFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
 CFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
 
+ifeq ($(DEB_HOST_ARCH), arm64)
+       CXXFLAGS += -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access
+       CFLAGS += -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access
+else ifeq ($(DEB_HOST_ARCH), armhf)
+       CXXFLAGS += -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access
+       CFLAGS += -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access
+endif
+
 name=tensorflow
 topdir=$(shell pwd)
 buildroot=${topdir}/debian/tmp
@@ -132,7 +140,13 @@ build:
 
        cd ${topdir}/build && make
 
+ifeq ($(DEB_HOST_ARCH), arm64)
+       make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS} -D__ARM_NEON" TIZEN_CFLAGS="${CFLAGS} -D__ARM_NEON"
+else ifeq ($(DEB_HOST_ARCH), armhf)
+       make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS} -D__ARM_NEON" TIZEN_CFLAGS="${CFLAGS} -D__ARM_NEON"
+else
        make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS}" TIZEN_CFLAGS="${CFLAGS}"
+endif
 
 install: build
        dh_testdir
@@ -202,4 +216,6 @@ clean:
        dh_testdir
        dh_testroot
        make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX clean
+       echo "[SJ_DEBUG] CXXFLAGS: " ${CXXFLAGS}
+       echo "[SJ_DEBUG] CFLAGS: " ${CFLAGS}
        dh_clean