1*e23db805SViktor Rosendahl# SPDX-License-Identifier: GPL-2.0 2*e23db805SViktor Rosendahl# Makefile for vm tools 3*e23db805SViktor Rosendahl# 4*e23db805SViktor RosendahlVAR_CFLAGS := $(shell pkg-config --cflags libtracefs 2>/dev/null) 5*e23db805SViktor RosendahlVAR_LDLIBS := $(shell pkg-config --libs libtracefs 2>/dev/null) 6*e23db805SViktor Rosendahl 7*e23db805SViktor RosendahlTARGETS = latency-collector 8*e23db805SViktor RosendahlCFLAGS = -Wall -Wextra -g -O2 $(VAR_CFLAGS) 9*e23db805SViktor RosendahlLDFLAGS = -lpthread $(VAR_LDLIBS) 10*e23db805SViktor Rosendahl 11*e23db805SViktor Rosendahlall: $(TARGETS) 12*e23db805SViktor Rosendahl 13*e23db805SViktor Rosendahl%: %.c 14*e23db805SViktor Rosendahl $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) 15*e23db805SViktor Rosendahl 16*e23db805SViktor Rosendahlclean: 17*e23db805SViktor Rosendahl $(RM) latency-collector 18*e23db805SViktor Rosendahl 19*e23db805SViktor Rosendahlprefix ?= /usr/local 20*e23db805SViktor Rosendahlsbindir ?= ${prefix}/sbin 21*e23db805SViktor Rosendahl 22*e23db805SViktor Rosendahlinstall: all 23*e23db805SViktor Rosendahl install -d $(DESTDIR)$(sbindir) 24*e23db805SViktor Rosendahl install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir) 25