sm: fix rebuild errors

Do the oe_runmake clean before do_compile to ensure
rebuild without errors.

Issue-ID: INF-44
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: Ib23c832383b1c37e81519e52edf2043cc10bbee0
diff --git a/meta-stx/recipes-core/stx-ha/sm-common.inc b/meta-stx/recipes-core/stx-ha/sm-common.inc
index 0b4ec9a..bdbcf76 100644
--- a/meta-stx/recipes-core/stx-ha/sm-common.inc
+++ b/meta-stx/recipes-core/stx-ha/sm-common.inc
@@ -28,7 +28,8 @@
 
 
 do_configure_prepend () {
-	:
+	cd ${S}/service-mgmt/sm-common/src
+	oe_runmake clean
 } 
 
 do_compile_prepend () {
@@ -47,9 +48,6 @@
  
 	cd ${S}/service-mgmt/sm-common/
 	install -d -m 755 ${D}/${systemd_system_unitdir}
-	# install -m 755 -d ${D}/${sysconfdir}/pmon.d
-	# install -m 755 -d ${D}/${sysconfdir}/init.d
-
 	install -m 644 -p -D scripts/sm-eru.service ${D}/${systemd_system_unitdir}/sm-eru.service
 	install -m 644 -p -D scripts/sm-watchdog.service ${D}/${systemd_system_unitdir}/sm-watchdog.service
 
diff --git a/meta-stx/recipes-core/stx-ha/sm-db.inc b/meta-stx/recipes-core/stx-ha/sm-db.inc
index b8e9923..4027fe3 100644
--- a/meta-stx/recipes-core/stx-ha/sm-db.inc
+++ b/meta-stx/recipes-core/stx-ha/sm-db.inc
@@ -18,7 +18,9 @@
 DEPENDS =+ "sqlite3-native"
 
 do_configure_append () {
-	:
+	cd ${S}/service-mgmt/sm-db
+	oe_runmake clean
+	rm -rf database/sm.db database/sm.hb.db
 } 
 
 do_compile_append () {
diff --git a/meta-stx/recipes-core/stx-ha/sm.inc b/meta-stx/recipes-core/stx-ha/sm.inc
index c19b496..d8488e2 100644
--- a/meta-stx/recipes-core/stx-ha/sm.inc
+++ b/meta-stx/recipes-core/stx-ha/sm.inc
@@ -26,6 +26,9 @@
 	"
 
 do_configure_append () {
+	cd ${S}/service-mgmt/sm/src
+	oe_runmake clean
+
 	# fix the hardcoded path
 	sed -i -e "s|/usr/local/sbin|${sbindir}|" \
 		${S}/service-mgmt/sm-common/src/sm_types.h \