makefile: honor build env CFLAGS and LDFLAGS

Generally build env (rpmbuild, dpkg-buildpackage) provide sane and
useful defaults.
Fixes hardening-no-relro lintian warning.

QubesOS/qubes-issues#1416
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-26 22:21:19 +01:00
parent 7148f8d135
commit d95174f52c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
CC=gcc
CFLAGS=-Wall -Wextra -Werror -g -O3
CFLAGS+=-Wall -Wextra -Werror -g -O3
all: meminfo-writer
SBINDIR?=/usr/sbin
@ -9,7 +9,7 @@ ifneq "$(_XENSTORE_H)" ""
endif
meminfo-writer: meminfo-writer.o
$(CC) -g -o meminfo-writer meminfo-writer.o -lxenstore
$(CC) $(LDFLAGS) -g -o meminfo-writer meminfo-writer.o -lxenstore
install:
install -D meminfo-writer $(DESTDIR)/$(SBINDIR)/meminfo-writer
ifeq (1,${DEBIANBUILD})

View File

@ -2,7 +2,7 @@ CC=gcc
CFLAGS+=-I. -g -O2 -Wall -Wextra -Werror -pie -fPIC `pkg-config --cflags vchan-$(BACKEND_VMM)`
COMMONIOALL=ioall.o
SO_VER=2
LDFLAGS=-shared
LDFLAGS+=-shared
VCHANLIBS = `pkg-config --libs vchan-$(BACKEND_VMM)`
_XENSTORE_H=$(shell ls /usr/include/xenstore.h)