File: cpp.mk

package info (click to toggle)
manpages 6.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,184 kB
  • sloc: sh: 575; python: 222; perl: 190; makefile: 29; lisp: 22
file content (43 lines) | stat: -rw-r--r-- 1,089 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright, the authors of the Linux man-pages project
# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception


ifndef MAKEFILE_CONFIGURE_BUILD_DEPENDS_CPP_CPP_INCLUDED
MAKEFILE_CONFIGURE_BUILD_DEPENDS_CPP_CPP_INCLUDED := 1


include $(MAKEFILEDIR)/configure/build-depends/coreutils/echo.mk
include $(MAKEFILEDIR)/configure/build-depends/gcc/cc.mk
include $(MAKEFILEDIR)/configure/build-depends/grep/grep.mk
include $(MAKEFILEDIR)/configure/build-depends/pkgconf/pkgconf.mk
include $(MAKEFILEDIR)/configure/verbose.mk


ifndef CPP
CPP := $(CC) $(CFLAGS_) -E
endif


CPP_HAS_ALREADY_D_FORTIFY_SOURCE := \
	$(shell \
		$(CPP) -dM - -Wno-error </dev/null \
		| $(GREP) ''\#'define _FORTIFY_SOURCE ' >/dev/null \
		&& $(ECHO) yes \
		|| $(ECHO) no; \
	)


DEFAULT_CPPFLAGS := \
	$(shell $(PKGCONF_CMD) --cflags $(PKGCONF_LIBS) $(HIDE_ERR))
ifeq ($(CPP_HAS_ALREADY_D_FORTIFY_SOURCE),no)
DEFAULT_CPPFLAGS += -D_FORTIFY_SOURCE=2
endif
ifndef CPPFLAGS
CPPFLAGS         :=
endif
ifndef CPPFLAGS_
CPPFLAGS_        := $(DEFAULT_CPPFLAGS) $(CPPFLAGS)
endif


endif  # include guard