summaryrefslogtreecommitdiffstats
path: root/rules/templates
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-04-21 07:06:22 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-04-21 14:04:52 +0200
commitbe768f9ee95ef423540d1cf84eeaa395aa7100a3 (patch)
tree0818d1f8a4e93219f238ab5f66f9b001888fc91e /rules/templates
parentd2a71a5b96d63c6062096f8fead8516dbcfd174e (diff)
downloadptxdist-be768f9ee95ef423540d1cf84eeaa395aa7100a3.tar.gz
ptxdist-be768f9ee95ef423540d1cf84eeaa395aa7100a3.tar.xz
[templates] add qmake template
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/templates')
-rw-r--r--rules/templates/src-qmake-prog/@name@.cpp8
-rw-r--r--rules/templates/src-qmake-prog/@name@.pro14
-rw-r--r--rules/templates/src-qmake-prog/install.pri11
-rw-r--r--rules/templates/src-qmake-prog/wizard.sh22
-rw-r--r--rules/templates/template-src-qmake-prog-in18
-rw-r--r--rules/templates/template-src-qmake-prog-make90
6 files changed, 163 insertions, 0 deletions
diff --git a/rules/templates/src-qmake-prog/@name@.cpp b/rules/templates/src-qmake-prog/@name@.cpp
new file mode 100644
index 000000000..f89e37e6f
--- /dev/null
+++ b/rules/templates/src-qmake-prog/@name@.cpp
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("hello fish!\n");
+ return 0;
+}
+
diff --git a/rules/templates/src-qmake-prog/@name@.pro b/rules/templates/src-qmake-prog/@name@.pro
new file mode 100644
index 000000000..204cd846f
--- /dev/null
+++ b/rules/templates/src-qmake-prog/@name@.pro
@@ -0,0 +1,14 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Wed Apr 21 07:03:40 2010
+######################################################################
+
+TEMPLATE = app
+TARGET = @name@
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += @name@.cpp
+
+include(install.pri)
+
diff --git a/rules/templates/src-qmake-prog/install.pri b/rules/templates/src-qmake-prog/install.pri
new file mode 100644
index 000000000..c3d2340bb
--- /dev/null
+++ b/rules/templates/src-qmake-prog/install.pri
@@ -0,0 +1,11 @@
+
+unix {
+ isEmpty(PREFIX) {
+ PREFIX = /usr
+ }
+ BINDIR = $$PREFIX/bin
+
+ INSTALLS += target
+ target.path = $$BINDIR
+}
+
diff --git a/rules/templates/src-qmake-prog/wizard.sh b/rules/templates/src-qmake-prog/wizard.sh
new file mode 100644
index 000000000..c6fe27fee
--- /dev/null
+++ b/rules/templates/src-qmake-prog/wizard.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+HERE=$(pwd)
+
+NAME=$1
+if [ -z "$NAME" ]; then
+ echo -n "project name: "
+ read NAME
+fi
+NAME_UP=$(echo $NAME | tr '[a-z-]' '[A-Z_]')
+
+mv "@name@.cpp" "${NAME}.cpp"
+mv "@name@.pro" "${NAME}.pro"
+
+for i in \
+ ${NAME}.pro \
+ ${NAME}.cpp \
+; do
+ sed -i -e "s/\@name\@/${NAME}/g" $i
+ sed -i -e "s/\@NAME\@/${NAME_UP}/g" $i
+done
+
diff --git a/rules/templates/template-src-qmake-prog-in b/rules/templates/template-src-qmake-prog-in
new file mode 100644
index 000000000..1556f3f4c
--- /dev/null
+++ b/rules/templates/template-src-qmake-prog-in
@@ -0,0 +1,18 @@
+## SECTION=fixme
+
+config @PACKAGE@
+ bool
+ prompt "@package@"
+ select QT4
+ help
+ FIXME
+
+if @PACKAGE@
+
+config @PACKAGE@_TRUNK
+ bool
+ prompt "use trunk"
+ help
+ Build trunk instead of latest release.
+
+endif
diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
new file mode 100644
index 000000000..900793634
--- /dev/null
+++ b/rules/templates/template-src-qmake-prog-make
@@ -0,0 +1,90 @@
+# -*-makefile-*-
+#
+# Copyright (C) @YEAR@ by @AUTHOR@
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_@PACKAGE@) += @package@
+
+#
+# Paths and names
+#
+ifdef PTXCONF_@PACKAGE@_TRUNK
+@PACKAGE@_VERSION := trunk
+else
+@PACKAGE@_VERSION := @VERSION@
+endif
+@PACKAGE@ := @package@-$(@PACKAGE@_VERSION)
+@PACKAGE@_URL := file://$(PTXDIST_WORKSPACE)/local_src/$(@PACKAGE@)
+@PACKAGE@_DIR := $(BUILDDIR)/$(@PACKAGE@)
+@PACKAGE@_BUILD_OOT := YES
+@PACKAGE@_LICENSE := unknown
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(@PACKAGE@_SOURCE):
+ @$(call targetinfo)
+ @$(call get, @PACKAGE@)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#@PACKAGE@_CONF_ENV := $(CROSS_ENV)
+
+#
+# qmake
+#
+@PACKAGE@_CONF_TOOL := qmake
+@PACKAGE@_CONF_OPT := $(CROSS_QMAKE_OPT) PREFIX=/usr
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/@package@.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, @package@)
+ @$(call install_fixup, @package@, PACKAGE, @packagedash@)
+ @$(call install_fixup, @package@, PRIORITY, optional)
+ @$(call install_fixup, @package@, VERSION, $(@PACKAGE@_VERSION))
+ @$(call install_fixup, @package@, SECTION, base)
+ @$(call install_fixup, @package@, AUTHOR, "@AUTHOR@")
+ @$(call install_fixup, @package@, DEPENDS,)
+ @$(call install_fixup, @package@, DESCRIPTION, missing)
+
+# #
+# # example code:; copy all binaries
+# #
+
+ @for i in $(shell cd $(@PACKAGE@_PKGDIR) && find bin sbin usr/bin usr/sbin -type f); do \
+ $(call install_copy, @package@, 0, 0, 0755, -, /$$i); \
+ done
+
+# #
+# # FIXME: add all necessary things here
+# #
+
+ @$(call install_finish, @package@)
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+#$(STATEDIR)/@package@.clean:
+# @$(call targetinfo)
+# @$(call clean_pkg, @PACKAGE@)
+
+# vim: syntax=make