You should always write command after a Tab and not white space.
This applies to gcc
line (line #4) in your case. You need to insert tab before gcc
.
Also replace \rm -fr ll
with rm -fr ll
. Insert tabs before this command too.
This is because tab is replaced by spaces. To disable this feature go to
gedit->edit->preferences->editor
and remove check for
"replace tab with space"
Your version of Linux doesn't support this kind of functionality please go for another suitable version i.e. Kali Linux or Red Hat.
The key point was "HARD TAB" 1. Check whether you used TAB instead of whitespace 2. Check your .vimrc for "set tabstop=X"
Using .editorconfig
to fix the tabs automagically:
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
Its pretty old question but still I would like say about one more option using vi/vim
editor to visualize the tabs. If you have vi/vim
installed then open a Makefile
(e.g. vim Makefile
) and enter :set list
. This will show number of tabs inserted as below,
%-linux: force$
^I@if [ "$(GCC_VERSION)" = "2.96" ] ; then \$
^I^Iecho ===== Generating build tree for legacy $@ architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $@ legacy; \$
^Ielse \$
^I^Iecho ===== Generating build tree for $@ architecture =====; \$
^I^I$(CONFIGURE) $(CWD) $@; \$
^Ifi$
^Icd build-$@;make$
If anyone of you are using a product from Intellij, the solution for this it's the following:
Other File Types
.Use tab character
and be careful, Tab size
and Indent
values must be 4.The solution for PyCharm
would be to install a Makefile support
plugin:
Preferences
(cmd + ,
)Plugins
-> Marketplace
Makefile support
, install and restart the IDE.This should fix the problem and provide a syntax for a makefile.
On VS Code, just click the "Space: 4" on the downright corner and change it to tab when editing your Makefile.
Source: Stackoverflow.com