Make it possible to compile the patterns utility with the source tree
authoranton <anton@openbsd.org>
Thu, 6 Jan 2022 13:18:36 +0000 (13:18 +0000)
committeranton <anton@openbsd.org>
Thu, 6 Jan 2022 13:18:36 +0000 (13:18 +0000)
checked out anywhere.

While here, tidy up the Makefile a bit.

ok deraadt@

usr.sbin/fw_update/Makefile

index a8d2406..fd6c2e6 100644 (file)
@@ -1,17 +1,16 @@
-#      $OpenBSD: Makefile,v 1.4 2022/01/05 16:24:29 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.5 2022/01/06 13:18:36 anton Exp $
 
-NOPROG=
+PROG=  patterns
 MAN=   fw_update.8
 CC=    ${HOSTCC}
-CFLAGS+=-I /usr/src/sys/dev/pci/drm/amd/amdgpu \
-       -I /usr/src/sys/dev/pci/drm/i915 \
-       -I /usr/src/sys/dev/pci/drm/radeon
-ALL=   firmware_patterns
+CFLAGS+=-I ${.CURDIR}/../../sys/dev/pci/drm/amd/amdgpu \
+       -I ${.CURDIR}/../../sys/dev/pci/drm/i915 \
+       -I ${.CURDIR}/../../sys/dev/pci/drm/radeon
 
-PROG=patterns
+CLEANFILES+=firmware_patterns
 
 firmware_patterns: patterns
-       $(.OBJDIR)/patterns | sort | uniq > $@
+       ${.OBJDIR}/patterns | sort | uniq > $@
 
 realinstall:
 
@@ -24,5 +23,4 @@ afterinstall: firmware_patterns
                -m ${SHAREMODE} ${.OBJDIR}/firmware_patterns \
                ${DESTDIR}${SHAREDIR}/misc/firmware_patterns
 
-CLEANFILES+=firmware_patterns
 .include <bsd.prog.mk>