summaryrefslogtreecommitdiff
path: root/package/helloworld/Makefile
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2016-12-10 00:12:49 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2016-12-10 00:12:49 +0100
commit1f0eb3671160c04d1ca61c39b35a446b5841b50c (patch)
treef24f20f38f6d353e271b6fd911683ea0c0193ab2 /package/helloworld/Makefile
parente183d9ba8e8bc5309fa145da1809c7e78489f05b (diff)
helloworld: add C++ test
Diffstat (limited to 'package/helloworld/Makefile')
-rw-r--r--package/helloworld/Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/package/helloworld/Makefile b/package/helloworld/Makefile
index c993cde38..a28d5ca9a 100644
--- a/package/helloworld/Makefile
+++ b/package/helloworld/Makefile
@@ -21,11 +21,31 @@ INSTALL_STYLE:= manual
do-build:
$(TARGET_CC) $(TARGET_CFLAGS) -o $(WRKBUILD)/helloworld $(WRKBUILD)/helloworld.c
+ifeq ($(ADK_TARGET_ARCH_METAG),)
$(TARGET_CC) $(TARGET_CFLAGS) -static -o $(WRKBUILD)/helloworld.static $(WRKBUILD)/helloworld.c
+endif
+ifeq ($(ADK_TOOLCHAIN_WITH_CXX),y)
+ $(TARGET_CXX) $(TARGET_CXXFLAGS) -o $(WRKBUILD)/helloworld-cxx $(WRKBUILD)/helloworld.cc
+ifeq ($(ADK_TARGET_ARCH_METAG),)
+ $(TARGET_CXX) $(TARGET_CXXFLAGS) -static -static-libstdc++ -o $(WRKBUILD)/helloworld-cxx.static $(WRKBUILD)/helloworld.cc
+endif
+endif
helloworld-install:
$(INSTALL_DIR) $(IDIR_HELLOWORLD)/usr/bin
- $(INSTALL_BIN) $(WRKBUILD)/helloworld{,.static} \
+ $(INSTALL_BIN) $(WRKBUILD)/helloworld \
$(IDIR_HELLOWORLD)/usr/bin
+ifeq ($(ADK_TARGET_ARCH_METAG),)
+ $(INSTALL_BIN) $(WRKBUILD)/helloworld.static \
+ $(IDIR_HELLOWORLD)/usr/bin
+endif
+ifeq ($(ADK_TOOLCHAIN_WITH_CXX),y)
+ $(INSTALL_BIN) $(WRKBUILD)/helloworld-cxx \
+ $(IDIR_HELLOWORLD)/usr/bin
+ifeq ($(ADK_TARGET_ARCH_METAG),)
+ $(INSTALL_BIN) $(WRKBUILD)/helloworld-cxx.static \
+ $(IDIR_HELLOWORLD)/usr/bin
+endif
+endif
include $(ADK_TOPDIR)/mk/pkg-bottom.mk