1SubDir HAIKU_TOP src apps devices ;
2
3UsePrivateHeaders shared ;
4UsePrivateHeaders interface ;
5UsePrivateKernelHeaders ;
6UsePrivateSystemHeaders ;
7
8
9rule ISAPnPHeaderGen
10{
11	SEARCH on $(2) = $(SEARCH_SOURCE) ;
12	SEARCH on $(3) = $(SEARCH_SOURCE) ;
13
14	Depends $(1) : $(2) $(3) ;
15	MakeLocateArch $(<) ;
16	ISAPnPHeaderGen1 $(1) : $(2) $(3) ;
17	LocalClean clean : $(<) ;
18}
19
20actions ISAPnPHeaderGen1
21{
22	grep '^PNP[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]] '  $(2[1]) \
23| awk -f $(2[2]) > $(1) ;
24}
25
26ISAPnPHeaderGen [ FGristFiles isapnpids.h ] : isapnp_devids.txt : devlist2h.awk ;
27
28rule PCIHeaderGen
29{
30	SEARCH on $(3) = $(SEARCH_SOURCE) ;
31
32	Depends $(1) : $(2) $(3) ;
33	MakeLocateArch $(<) ;
34	PCIHeaderGen1 $(1) : $(2) $(3) ;
35	LocalClean clean : $(<) ;
36}
37
38actions PCIHeaderGen1
39{
40	awk -v HEADERFILE=$(1) -f $(2[2]) $(2[1])
41}
42
43local pciidsFile = pci.ids ;
44SEARCH on $(pciidsFile) = [ FDirName $(HAIKU_TOP) src data ids ] ;
45
46PCIHeaderGen [ FGristFiles pcihdr.h ] : $(pciidsFile) : pci-header.awk ;
47
48rule USBHeaderGen
49{
50	SEARCH on $(3) = $(SEARCH_SOURCE) ;
51
52	Depends $(1) : $(2) $(3) ;
53	MakeLocateArch $(<) ;
54	USBHeaderGen1 $(1) : $(2) $(3) ;
55	LocalClean clean : $(<) ;
56}
57
58actions USBHeaderGen1
59{
60	awk -v HEADERFILE=$(1) -f $(2[2]) $(2[1])
61}
62
63local usbidsFile = usb.ids ;
64SEARCH on $(usbidsFile) = [ FDirName $(HAIKU_TOP) src data ids ] ;
65
66USBHeaderGen [ FGristFiles usbhdr.h ] : $(usbidsFile) : usb-header.awk ;
67
68rule ACPIPnPHeaderGen
69{
70	SEARCH on $(2) = $(SEARCH_SOURCE) ;
71
72	Depends $(1) : $(2) $(3) ;
73	MakeLocateArch $(<) ;
74	ACPIPnPHeaderGen1 $(1) : $(2) $(3) ;
75	LocalClean clean : $(<) ;
76}
77
78actions ACPIPnPHeaderGen1
79{
80	awk -f $(2[1]) $(2[2-]) > $(1) ;
81}
82
83# files can be updated so:
84# curl --fail -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export'
85# curl --fail -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export'
86local acpiidsFiles = acpi_id_registry.html pnp_id_registry.html ;
87SEARCH on $(acpiidsFiles) = [ FDirName $(HAIKU_TOP) src data ids ] ;
88
89ACPIPnPHeaderGen [ FGristFiles acpipnpids.h ]
90	:  acpipnplist2h.awk : $(acpiidsFiles) ;
91
92Application Devices :
93	DevicesApplication.cpp
94	DevicesView.cpp
95	dm_wrapper.c
96	DeviceACPI.cpp
97	DevicePCI.cpp
98	DeviceSCSI.cpp
99	DeviceUSB.cpp
100	Device.cpp
101	PropertyList.cpp
102	: be libcolumnlistview.a tracker [ TargetLibsupc++ ]
103		[ TargetLibstdc++ ]	localestub
104	: Devices.rdef
105;
106
107DoCatalogs Devices :
108	x-vnd.Haiku-Devices
109	:
110	DevicesApplication.cpp
111	DevicesView.cpp
112	DevicePCI.cpp
113	PropertyList.cpp
114	DeviceACPI.cpp
115	DeviceSCSI.cpp
116	Device.cpp
117;
118
119Includes [ FGristFiles DeviceACPI.cpp ] : [ FGristFiles acpipnpids.h ] ;
120Includes [ FGristFiles DevicePCI.cpp ] : [ FGristFiles pcihdr.h ] ;
121Includes [ FGristFiles DeviceUSB.cpp ] : [ FGristFiles usbhdr.h ] ;
122
123