CC = gcc CFLAGS = -Wall -O2 -g -D_GNU_SOURCE INCLUDES = $(shell pkg-config dbus-1 --cflags) LDFLAGS = LIBS = $(shell pkg-config dbus-1 --libs) PREFIX = /usr mtetherd: mtetherd.o device.o $(CC) $(LDFLAGS) $(LIBS) -o $@ $^ %PHONY: clean install uninstall clean: rm -f *.o mtetherd install: mtetherd install -m 755 -D mtetherd $(DESTDIR)/$(PREFIX)/sbin/mtetherd install -m 644 -D event.d-mtetherd $(DESTDIR)/etc/event.d/mtetherd install -m 644 -D README $(DESTDIR)/$(PREFIX)/share/doc/mtetherd/README uninstall: rm -f $(DESTDIR)/$(PREFIX)/sbin/mtetherd rm -f $(DESTDIR)/etc/event.d/mtetherd rm -rf $(DESTDIR)/$(PREFIX)/share/doc/mtetherd %.o: %.c $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $^