xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/Jamfile (revision cfc3fa87da824bdf593eb8b817a83b6376e77935)
1SubDir HAIKU_TOP src add-ons media media-add-ons usb_webcam ;
2
3SetSubDirSupportedPlatformsBeOSCompatible ;
4
5# Zeta has a libusb.so, we have it in libdevice.so
6if $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
7	usbKitLibraryName = libdevice.so ;
8} else {
9	usbKitLibraryName = usb ;
10}
11
12# source directories
13local sourceDirs =
14	addons/quickcam
15	addons/sonix
16	cstransforms
17	sensors
18;
19
20local sourceDir ;
21for sourceDir in $(sourceDirs) {
22	SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons
23		usb_webcam $(sourceDir) ] ;
24}
25
26## addon sources
27local addonSources ;
28addonSources = QuickCamDevice.cpp SonixCamDevice.cpp ;
29
30## colorspace transforms sources
31local csTransformsSources ;
32csTransformsSources = Bayer.cpp ;
33
34## sensors sources
35local sensorsSources ;
36sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ;
37
38## how to build header files from sources to include the list of built-in addons.
39# but it doesn't seem to work for some reason...
40
41rule USBWebcamHeaderGen header : macro : sources
42{
43	SEARCH on $(sources) = $(SEARCH_SOURCE) ;
44
45	Depends $(header) : $(sources) ;
46	MakeLocateArch $(header) ;
47	GREP_DEFINE on $(header) = $(macro) ;
48	USBWebcamHeaderGen1 $(header) : $(sources) ;
49	LocalClean clean : $(header) ;
50}
51
52actions USBWebcamHeaderGen1
53{
54	grep -h $(GREP_DEFINE) $(2) > $(1) ;
55}
56
57USBWebcamHeaderGen [ FGristFiles CamInternalAddons.h ]
58	: B_WEBCAM_MKINTFUNC : $(addonSources) ;
59USBWebcamHeaderGen [ FGristFiles CamInternalSensors.h ]
60	: B_WEBCAM_DECLARE_SENSOR : $(sensorsSources) ;
61USBWebcamHeaderGen [ FGristFiles CamInternalColorSpaceTransforms.h ]
62	: B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ;
63
64Addon usb_webcam.media_addon :
65	$(addonSources)
66	$(csTransformsSources)
67	$(sensorsSources)
68	AddOn.cpp
69	Producer.cpp
70	CamBufferedFilterInterface.cpp
71	CamBufferingDeframer.cpp
72	CamColorSpaceTransform.cpp
73	CamDeframer.cpp
74	CamDevice.cpp
75	CamFilterInterface.cpp
76	CamRoster.cpp
77	CamSensor.cpp
78	CamStreamingDeframer.cpp
79	: be media $(usbKitLibraryName)
80;
81
82# force dependancies
83Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ;
84Includes [ FGristFiles CamDevice.cpp ] : [ FGristFiles CamInternalSensors.h ] ;
85Includes [ FGristFiles CamColorSpaceTransform.cpp ]
86	: [ FGristFiles CamInternalColorSpaceTransforms.h ] ;
87