#!/bin/sh # $NetBSD: i915drmkms2netbsd,v 1.3 2021/12/19 00:25:19 riastradh Exp $ # # $ /path/to/i915drmkms2netbsd > /path/to/files.i915drmkms.new # # Run from the top-level i915drmkms source directory. set -Ceu : ${GMAKE:=gmake} # Location of the i915drmkms sources relative to $NETBSDSRCDIR. i915drmkms_top=external/bsd/drm2/dist/drm/i915 # config(5) flag for the i915drmkms driver. i915drmkms_flag=i915drmkms { printf 'show-i915-y:\n' printf '\t@echo $(i915-y)\n' printf 'include Makefile\n' } | env \ env CONFIG_ACPI=y \ env CONFIG_DRM_FBDEV_EMULATION=y \ env src=. \ ${GMAKE} -f - -s show-i915-y \ | tr ' ' '\n' \ | grep -v '^$' \ | sed -e 's,\.o$,.c,' \ | sort -u \ | while read f; do printf 'file\t%s\t%s\n' "$i915drmkms_top/$f" "$i915drmkms_flag" done