2014-01-05 04:32:57 +00:00
|
|
|
CC=gcc
|
2015-11-26 21:21:19 +00:00
|
|
|
CFLAGS+=-Wall -Wextra -Werror -g -O3
|
2014-01-05 04:32:57 +00:00
|
|
|
all: meminfo-writer
|
2015-07-08 12:33:48 +00:00
|
|
|
SBINDIR?=/usr/sbin
|
2014-04-21 01:14:32 +00:00
|
|
|
|
|
|
|
_XENSTORE_H=$(shell ls /usr/include/xenstore.h)
|
|
|
|
ifneq "$(_XENSTORE_H)" ""
|
|
|
|
CFLAGS+= -DUSE_XENSTORE_H
|
|
|
|
endif
|
|
|
|
|
2014-01-05 04:32:57 +00:00
|
|
|
meminfo-writer: meminfo-writer.o
|
2015-11-26 21:21:19 +00:00
|
|
|
$(CC) $(LDFLAGS) -g -o meminfo-writer meminfo-writer.o -lxenstore
|
2014-01-05 04:32:57 +00:00
|
|
|
install:
|
2015-07-08 12:33:48 +00:00
|
|
|
install -D meminfo-writer $(DESTDIR)/$(SBINDIR)/meminfo-writer
|
2014-09-25 15:20:14 +00:00
|
|
|
ifeq (1,${DEBIANBUILD})
|
|
|
|
install -d $(DESTDIR)/lib/systemd/system/
|
|
|
|
install -m 0644 qubes-meminfo-writer.service $(DESTDIR)/lib/systemd/system/
|
|
|
|
else
|
2014-01-05 04:32:57 +00:00
|
|
|
install -d $(DESTDIR)/usr/lib/systemd/system/
|
2015-06-16 00:59:49 +00:00
|
|
|
install -m 0644 qubes-meminfo-writer*service $(DESTDIR)/usr/lib/systemd/system/
|
2014-04-21 01:24:12 +00:00
|
|
|
endif
|
2014-01-05 04:32:57 +00:00
|
|
|
clean:
|
|
|
|
rm -f meminfo-writer xenstore-watch *.o
|