qubes-linux-utils/qmemman/Makefile
Marek Marczykowski-Górecki d95174f52c
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
2015-11-26 22:21:19 +01:00

24 lines
696 B
Makefile

CC=gcc
CFLAGS+=-Wall -Wextra -Werror -g -O3
all: meminfo-writer
SBINDIR?=/usr/sbin
_XENSTORE_H=$(shell ls /usr/include/xenstore.h)
ifneq "$(_XENSTORE_H)" ""
CFLAGS+= -DUSE_XENSTORE_H
endif
meminfo-writer: meminfo-writer.o
$(CC) $(LDFLAGS) -g -o meminfo-writer meminfo-writer.o -lxenstore
install:
install -D meminfo-writer $(DESTDIR)/$(SBINDIR)/meminfo-writer
ifeq (1,${DEBIANBUILD})
install -d $(DESTDIR)/lib/systemd/system/
install -m 0644 qubes-meminfo-writer.service $(DESTDIR)/lib/systemd/system/
else
install -d $(DESTDIR)/usr/lib/systemd/system/
install -m 0644 qubes-meminfo-writer*service $(DESTDIR)/usr/lib/systemd/system/
endif
clean:
rm -f meminfo-writer xenstore-watch *.o