]> the.earth.li Git - mqtt-arp.git/commitdiff
Add a basic install target to the Makefile
authorJonathan McDowell <noodles@earth.li>
Wed, 9 Feb 2022 18:31:41 +0000 (18:31 +0000)
committerJonathan McDowell <noodles@earth.li>
Wed, 9 Feb 2022 18:31:41 +0000 (18:31 +0000)
Helpful when building a package.

Makefile

index 2aefb524058675ef02427e00b8a8838c34c06e2c..75af65d85a12a6155b541436e5c14b4fd7dcc668 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,12 @@ all: mqtt-arp
 mqtt-arp: mqtt-arp.o
        $(CC) -o $@ $< $(LDFLAGS) -lmosquitto
 
+install: mqtt-arp
+       install -d $(DESTDIR)/etc
+       install -d $(DESTDIR)/usr/sbin
+       install mqtt-arp $(DESTDIR)/usr/sbin/
+       install -m 600 mqtt-arp.conf $(DESTDIR)/etc/
+
 %.o: %.c
        $(CC) -c -o $@ $< $(CFLAGS)