xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/Jamfile (revision d374a27286b8a52974a97dba0d5966ea026a665d)
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 = USBKit.a ;
10#	UsePublicHeaders [ FDirName drivers ] ;
11#	UsePublicHeaders [ FDirName device ] ;
12	# use -lusb on ZETA
13	usbKitLibraryName = usb ;
14}
15
16# source directories
17local sourceDirs =
18	addons/quickcam
19	addons/sonix
20	addons/uvc
21	addons
22	cstransforms
23	sensors
24;
25
26local sourceDir ;
27for sourceDir in $(sourceDirs) {
28	SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons
29		usb_webcam $(sourceDir) ] ;
30}
31
32## addon sources
33local addonSources ;
34addonSources =
35	QuickCamDevice.cpp
36	SonixCamDevice.cpp
37	NW80xCamDevice.cpp
38#	UVCCamDevice.cpp
39;
40
41## colorspace transforms sources
42local csTransformsSources ;
43csTransformsSources = Bayer.cpp ;
44
45## sensors sources
46local sensorsSources ;
47sensorsSources =
48	hdcs1000.cpp
49	hv7131e1.cpp
50	pas106b.cpp
51	pb0100.cpp
52	tas5110c1b.cpp
53	tas5130d1b.cpp
54;
55
56## how to build header files from sources to include the list of built-in addons
57
58rule USBWebcamHeaderGen header : macro : sources
59{
60	header = [ FGristFiles $(header) ] ;
61	sources = [ FGristFiles $(sources) ] ;
62
63	SEARCH on $(sources) = $(SEARCH_SOURCE) ;
64
65	Depends $(header) : $(sources) ;
66	MakeLocateArch $(header) ;
67	GREP_DEFINE on $(header) = $(macro) ;
68	USBWebcamHeaderGen1 $(header) : $(sources) ;
69	LocalClean clean : $(header) ;
70}
71
72actions USBWebcamHeaderGen1
73{
74	grep -h -a $(GREP_DEFINE) $(2) > $(1) ;
75}
76
77USBWebcamHeaderGen CamInternalAddons.h : B_WEBCAM_MKINTFUNC : $(addonSources) ;
78USBWebcamHeaderGen CamInternalSensors.h : B_WEBCAM_DECLARE_SENSOR
79	: $(sensorsSources) ;
80USBWebcamHeaderGen CamInternalColorSpaceTransforms.h
81	: B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ;
82
83Addon usb_webcam.media_addon :
84	$(addonSources)
85	$(csTransformsSources)
86	$(sensorsSources)
87	AddOn.cpp
88	Producer.cpp
89	CamBufferedFilterInterface.cpp
90	CamBufferingDeframer.cpp
91	CamColorSpaceTransform.cpp
92	CamDeframer.cpp
93	CamDevice.cpp
94	CamFilterInterface.cpp
95	CamRoster.cpp
96	CamSensor.cpp
97	CamStreamingDeframer.cpp
98	: be media $(usbKitLibraryName) $(TARGET_LIBSUPC++)
99;
100
101# force dependancies
102Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ;
103Includes [ FGristFiles CamDevice.cpp ] : [ FGristFiles CamInternalSensors.h ] ;
104Includes [ FGristFiles CamColorSpaceTransform.cpp ]
105	: [ FGristFiles CamInternalColorSpaceTransforms.h ] ;
106