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