File: Makefile.wrapper

package info (click to toggle)
hardening-wrapper 2.6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 196 kB
  • ctags: 81
  • sloc: perl: 495; makefile: 284; sh: 257; ansic: 85
file content (32 lines) | stat: -rwxr-xr-x 850 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

WRAPPED_CC=$(BUILD_TREE)/hardened-cc
WRAPPED_CXX=$(BUILD_TREE)/hardened-c++
WRAPPED_LD=$(BUILD_TREE)/hardened-ld

# It seems that GCC_EXEC_PREFIX does not behave the same across all
# architectures, so we need to pass the -B flag instead.
CC=$(WRAPPED_CC) -B $(BUILD_TREE)/

WRAPPERS=$(WRAPPED_CC) $(WRAPPED_LD) $(WRAPPED_CXX)

SYNTAX_STAMP=syntax.stamp
SYMLINKED_LD=$(BUILD_TREE)/ld

export HARDENING_USE_USR_BIN=1
export DEB_BUILD_HARDENING=1
export DEB_BUILD_HARDENING_DEBUG=1

NAME:=wrapper

include Makefile.common

$(SYNTAX_STAMP): $(WRAPPERS)
	# Test basic perl syntax
	for script in $(WRAPPERS); do perl -c $$script; done
	touch $@

$(SYMLINKED_LD): $(WRAPPED_LD)
	# Enable symlink for ld to trick gcc into doing wrapped linking
	(cd $(BUILD_TREE) && ln -s hardened-ld ld)
	(cd $(BUILD_TREE) && ln -s hardened-ld ld.gold)