public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] IDE: support QT Creator
Date: Tue, 13 Apr 2021 01:10:49 +0300	[thread overview]
Message-ID: <YHTFaSEVBccTf9SJ@fedora> (raw)

Add little script to generate QT Creator project files, so that parsing
and navigating codebase mostly works.

The important part is to run 'make prepare' before opening project
so that generated headers are picked up and clone&fixup coding style
in the editor to match kernel coding style.

Then run

	$ ./scripts/ide/qt-creator.sh xxx

from top-level directory

Note:
ibmvnic.c is excluded from project files to workaround libCPlusPlus crash.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 scripts/ide/qt-creator.sh |   49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

new file mode 100755
--- /dev/null
+++ b/scripts/ide/qt-creator.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+# Copyright (c) 2021 Alexey Dobriyan <adobriyan@gmail.com>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# Generate Qt Creator project files.
+set -eo pipefail
+
+test -n "$1" || { echo >&2 "usage: $0 project-name"; exit 1; }
+p="$1"
+
+filename="$p.cflags"
+echo "$filename"
+echo '-std=gnu89' >"$filename"
+
+filename="$p.config"
+echo $filename
+cat <<EOF >$filename
+#define __KERNEL__
+#include <linux/kconfig.h>
+EOF
+
+filename="$p.creator"
+echo $filename
+echo '[General]' >$filename
+
+filename="$p.cxxflags"
+echo $filename
+echo '-std=gnu++17' >$filename
+
+filename="$p.files"
+echo $filename
+# ibmvnic.c: workaround https://bugzilla.redhat.com/show_bug.cgi?id=1886548
+git ls-tree -r HEAD --name-only | LC_ALL=C sort | grep -v -e 'ibmvnic.c' >$filename
+
+filename="$p.includes"
+echo $filename
+echo 'include' >$filename
+for i in arch/*/include; do echo $i; done | LC_ALL=C sort >>$filename

                 reply	other threads:[~2021-04-12 22:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHTFaSEVBccTf9SJ@fedora \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox