All of lore.kernel.org
 help / color / mirror / Atom feed
From: dangets@gmail.com (DG)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Need help: How to set .RECIPEPREFIX variable to whitespaces
Date: Wed, 13 Jul 2011 08:33:33 -0600	[thread overview]
Message-ID: <CAPidF46aU7Aa7Hq6UCX=yosS-dinMD7kAmkbr7TMnNu+kdQc-g@mail.gmail.com> (raw)
In-Reply-To: <CAOUxTKMo+yLwg27R3CmF0afx58VjetFHN0ZTZc49EC=hNhR+ww@mail.gmail.com>

On Wed, Jul 13, 2011 at 1:52 AM, amit mehta <gmate.amit@gmail.com> wrote:
> Hi,
>
> How to set .RECIPEPREFIX variable to whitespace(say 4 whitespces) , so that
> make uses this particular set of characters to identify the recipe for
> a particular target.
> In my $HOME/.vimrc file, for code indentation purpose, I've put the
> following entries
> to replace tabs with 4 whitespaces:
>
> <<<snip from my $HOME/.vimrc file>>>
> "replace tabs with spaces
> set expandtab
> set shiftwidth=4
> set tabstop=4
> <<<snip from my $HOME/.vimrc file>>>
>
>
> but the above will cause problem in case you write your own makefile
> for a kernel module,
> because now the tab stroke will be replaced by 4 whitespaces which
> 'make' will not understand.
> Quoting from 'make' manual,
> "Please note: you need to put a tab character at the beginning of
> every recipe line!"
>
> Seems .RECIPEPREFIX will come for resuce, but as of now I don't know
> how to use it
> to fix my problem.
>
> Regards,
> Amit
>
> --
> Life is elsewhere. Cross Frontiers. Fly away.
>
> - Salman Rushdie
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

I have my vimrc file setup to use different tabs/spacing depending on
the filetype.  8-width tab in C, 4-space indent in Python, etc...

Here's a snippet from my vimrc:

"-------- C -------------------------
function! LANG_C()
    setlocal noexpandtab
    setlocal shiftwidth=8
    setlocal tabstop=8
    setlocal softtabstop=8
    setlocal formatoptions=tcroq
endfunction
autocmd FileType c call LANG_C()

"------- Python ----------------
function! LANG_PYTHON()
    setlocal shiftwidth=4
    setlocal tabstop=4
    setlocal softtabstop=4
    setlocal expandtab
    "--- python indent keywords --------
    setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class,with
endfunction
autocmd FileType python call LANG_PYTHON()

"------- Makefile --------------
function! LANG_MAKEFILE()
    setlocal noexpandtab     " makefiles only work with tab-indents
    setlocal shiftwidth=8
    setlocal tabstop=8
    setlocal softtabstop=8
endfunction
autocmd FileType make call LANG_MAKEFILE()


There may be other/better ways to do this, but it works well for me.

  reply	other threads:[~2011-07-13 14:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  7:52 Need help: How to set .RECIPEPREFIX variable to whitespaces amit mehta
2011-07-13 14:33 ` DG [this message]
     [not found]   ` <CAOUxTKO4pxUYxRNvpYO+M7bXNcskerJ=+iq9Cg82GTOhmkG4ew@mail.gmail.com>
2011-07-25 12:29     ` amit mehta

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='CAPidF46aU7Aa7Hq6UCX=yosS-dinMD7kAmkbr7TMnNu+kdQc-g@mail.gmail.com' \
    --to=dangets@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.