Browse Source

new package helloworld, add a package for regression testing with embedded-test

Waldemar Brodkorb 7 years ago
parent
commit
e183d9ba8e
3 changed files with 40 additions and 0 deletions
  1. 3 0
      mk/build.mk
  2. 31 0
      package/helloworld/Makefile
  3. 6 0
      package/helloworld/src/helloworld.c

+ 3 - 0
mk/build.mk

@@ -348,6 +348,9 @@ defconfig: .menu $(CONFIG)/conf
 	@if [ ! -z "$(ADK_TEST_BASE)" ];then \
 		echo "ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR)/.defconfig; \
 	fi
+	@if [ ! -z "$(ADK_TEST_TOOLCHAIN)" ];then \
+		echo "ADK_PACKAGE_HELLOWORLD=y" >> $(ADK_TOPDIR)/.defconfig; \
+	fi
 	@if [ ! -z "$(ADK_TEST_LTP)" ];then \
 		echo "ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR)/.defconfig; \
 		echo "ADK_PACKAGE_FILE=y" >> $(ADK_TOPDIR)/.defconfig; \

+ 31 - 0
package/helloworld/Makefile

@@ -0,0 +1,31 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:=		helloworld
+PKG_VERSION:=		1.0
+PKG_RELEASE:=		1
+PKG_DESCR:=		hello world
+PKG_SECTION:=		base/tests
+
+NO_DISTFILES:=		1
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,HELLOWORLD,helloworld,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+do-build:
+	$(TARGET_CC) $(TARGET_CFLAGS) -o $(WRKBUILD)/helloworld $(WRKBUILD)/helloworld.c
+	$(TARGET_CC) $(TARGET_CFLAGS) -static -o $(WRKBUILD)/helloworld.static $(WRKBUILD)/helloworld.c
+
+helloworld-install:
+	$(INSTALL_DIR) $(IDIR_HELLOWORLD)/usr/bin
+	$(INSTALL_BIN) $(WRKBUILD)/helloworld{,.static} \
+		$(IDIR_HELLOWORLD)/usr/bin
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 6 - 0
package/helloworld/src/helloworld.c

@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main() {
+  printf("Hello World\n");
+  return 0;
+}