xref: /netbsd-src/sys/external/bsd/drm2/i915drm/i915drmkms2netbsd (revision d536862b7d93d77932ef5de7eebdc48d76921b77)
1#!/bin/sh
2
3#	$NetBSD: i915drmkms2netbsd,v 1.3 2021/12/19 00:25:19 riastradh Exp $
4#
5# $ /path/to/i915drmkms2netbsd > /path/to/files.i915drmkms.new
6#
7# Run from the top-level i915drmkms source directory.
8
9set -Ceu
10
11: ${GMAKE:=gmake}
12
13# Location of the i915drmkms sources relative to $NETBSDSRCDIR.
14i915drmkms_top=external/bsd/drm2/dist/drm/i915
15
16# config(5) flag for the i915drmkms driver.
17i915drmkms_flag=i915drmkms
18
19{
20	printf 'show-i915-y:\n'
21	printf '\t@echo $(i915-y)\n'
22	printf 'include Makefile\n'
23} | env \
24	env CONFIG_ACPI=y \
25	env CONFIG_DRM_FBDEV_EMULATION=y \
26	env src=. \
27	${GMAKE} -f - -s show-i915-y \
28| tr ' ' '\n' \
29| grep -v '^$' \
30| sed -e 's,\.o$,.c,' \
31| sort -u \
32| while read f; do
33	printf 'file\t%s\t%s\n' "$i915drmkms_top/$f" "$i915drmkms_flag"
34done
35