I cannot post this line on github: ifneq ($(findstring ARM,$(OSARCH)),) It always show…
- User
I cannot post this line on github:
ifneq ((OSARCH)),)
It always show this:
ifneq ( ( f i n d s t r i n g A R M , (OSARCH)),)
What can i do?
- Assistant
This problem happens because GitHub's web interface (and some other Markdown renderers) try to interpret parentheses and commas inside Makefile conditionals as part of Markdown syntax or list syntax, messing up the line when you post it as-is.
To solve this, you should put your code inside a fenced code block with the right language/specifier, so markdown renders it as code and keeps everything intact.
For example, on GitHub, use triple backticks with
make(or just plain) before and after your code snippet:This will show the line exactly as you wrote it and prevent the strange splitting.
If you want to post it inline in your comment or issue, you can use single backticks
`to surround it, like:`ifneq ($(findstring ARM,$(OSARCH)),)`But multiline code blocks are much clearer.
Summary:
- Wrap your Makefile code in triple backticks (
) with `make` or nothing after the first - Paste your code inside that block
- This prevents GitHub from misinterpreting the syntax
- Wrap your Makefile code in triple backticks (
- User
This is the text/code: ifeq ((shell cmd /C echo %PROCESSOR_ARCHITECTURE%) OS := windows GENIEOS := windows ifneq ((OSARCH)),) PLATFORM := arm64 else PLATFORM := x86 endif
- Assistant
To post that
Makefilesnippet correctly on GitHub so it displays as intended, wrap it inside a fenced code block with triple backticks and optionally specifymakeas the language for syntax highlighting.For example, paste this in your GitHub issue, comment, or README:
makeifeq ($(OS),Windows_NT) OSARCH := $(shell cmd /C echo %PROCESSOR_ARCHITECTURE%) OS := windows GENIEOS := windows ifneq ($(findstring ARM,$(OSARCH)),) PLATFORM := arm64 else PLATFORM := x86 endifThis keeps everything intact and prevents GitHub from breaking your
ifneqline into unwanted characters.
Explanation
If you post it without backticks, GitHub/Mardown tries to parse parentheses, commas, and
$as Markdown or special characters, scrambling the code.Using fenced code blocks tells GitHub to treat the content as verbatim code.
If you want to share it inline (not multiline), use single backticks: