diff options
-rw-r--r-- | mk/build.mk | 3 | ||||
-rw-r--r-- | package/helloworld/Makefile | 31 | ||||
-rw-r--r-- | package/helloworld/src/helloworld.c | 6 |
3 files changed, 40 insertions, 0 deletions
diff --git a/mk/build.mk b/mk/build.mk index f089a35c2..78b4789e3 100644 --- a/mk/build.mk +++ b/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; \ diff --git a/package/helloworld/Makefile b/package/helloworld/Makefile new file mode 100644 index 000000000..c993cde38 --- /dev/null +++ b/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 diff --git a/package/helloworld/src/helloworld.c b/package/helloworld/src/helloworld.c new file mode 100644 index 000000000..232880377 --- /dev/null +++ b/package/helloworld/src/helloworld.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +int main() { + printf("Hello World\n"); + return 0; +} |