0

I have a makefile which gives the following error in OS X, I will be very grateful if someone have an idea about why is getting this error: ./../../../..//Source//templates/gcc/Makefile.posix:15: *** missing separator. Stop. Here is the makefile:

GNU_INSTALL_ROOT := /usr/local/gcc-arm-none-eabi-4_8-2014q3
GNU_VERSION := 4.8.3
GNU_PREFIX := arm-none-eabi
GDB_PORT_NUMBER := 9992

FLASH_START_ADDR = $(shell $(OBJDUMP) -h    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out -j .text | grep .text | awk '{print $$4}')

JLINK_OPTS = -device nrf51822 -if swd -speed 4000
JLINK_GDB_OPTS = -noir
JLINK = JLinkExe $(JLINK_OPTS)
JLINKD_GDB = JLinkGDBServer $(JLINK_GDB_OPTS)


flash-jlink: flash.jlink
    $(JLINK) flash.jlink

flash.jlink:
    printf "loadbin $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin $(FLASH_START_ADDR)\nr\ng\nexit\n" > flash.jlink

erase-all: erase-all.jlink
    $(JLINK) erase-all.jlink

erase-all.jlink:
    # Write to NVMC to enable erase, do erase all, wait for completion. reset
    printf "w4 4001e504 2\nw4 4001e50c 1\nsleep 100\nr\nexit\n" > erase-all.jlink

run-debug:
    $(JLINKD_GDB) $(JLINK_OPTS) $(JLINK_GDB_OPTS) -port $(GDB_PORT_NUMBER)

.PHONY:  flash-jlink flash.jlink erase-all erase-all.jlink run-debug
  • "Missing separator" almost always means that one of your command lines does not start with a tab character. Make sure that the first character in each command line is a tab, not a space. – John Bode Oct 16 '14 at 14:37
  • There are various possibilities. Definitely @JohnBode's answer is very likely. If you'd actually pasted the exact error message instead of paraphrasing it in the title, then we could probably tell you definitively, because the message will contain a line number... without that we're just guessing. – MadScientist Oct 17 '14 at 00:13
  • true, sorry:../../../../..//Source//templates/gcc/Makefile.posix:15: *** missing separator. Stop. – Al Baldrick li suen els ous Oct 17 '14 at 17:48
  • John's comment is relevant. Did you verify that line 15 does indeed start with a tab and not spaces? – Mat Oct 18 '14 at 10:29
  • indeed, line 15 start with a tab.. so strange – Al Baldrick li suen els ous Oct 18 '14 at 21:24
  • Does this answer your question? [Make error: missing separator](https://stackoverflow.com/questions/920413/make-error-missing-separator) – SuperStormer Feb 18 '23 at 04:33

3 Answers3

1

TAB character in Brackets editor were replaced by 4 spaces (sp sp sp sp). Changing to other editor (TextMate) solved the problem

1

I was using VIM (on MacOS) and found that 'expandtab' was the issue when parsing Makefiles. If set, it turns your tab into 4 spaces. (so i commented it out)

" expand tabs into spaces

"set expandtab

0

On Mac OS X and SublimeText 3 I had to change the indentation from spaces to tabs to solve the same problem '"Makefile:4: *** missing separator. Stop."'.

So I did the following on SublimeText 3 in the lower left corner to fix the error:

  • Click on Spaces:4 > Tab Width: 4
  • Click on Spaces: 4 > Convert Indentation to Tab
Daniel
  • 1
  • 1