File: general.make

package info (click to toggle)
sope 4.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,492 kB
  • sloc: objc: 167,993; sh: 3,648; ansic: 3,405; python: 318; makefile: 189
file content (27 lines) | stat: -rw-r--r-- 922 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Macros that allow testing for GCC flag existence
try-run = $(shell set -e;                      \
	TMP="/tmp/SOPE-gcc-flags-check.$$$$.tmp";  \
	TMPO="/tmp/SOPE-gcc-flags-check.$$$$.o";   \
	if ($(1)) >/dev/null 2>&1;                 \
	then echo "$(2)";                          \
	else echo "$(3)";                          \
	fi;                                        \
	rm -f "$$TMP" "$$TMPO")

cc-option = $(call try-run,\
	$(CC) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))

# Use GCC level 2 optimization by default
# Might be overridden below
ADDITIONAL_OBJCFLAGS=-O2
ifeq ($(debug),yes)
ADDITIONAL_OBJCFLAGS=-O0
else
ADDITIONAL_OBJCFLAGS=-Wuninitialized
endif
# Ensure we store in the ELF files minimal debugging
# information plus the compiler flags used; that can
# be afterwards read with:
# readelf -p .GCC.command.line /path/to/elf_file
ADDITIONAL_OBJCFLAGS += -g $(call cc-option,-frecord-gcc-switches)