xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/Jamfile (revision 83b1a68c52ba3e0e8796282759f694b7fdddf06d)
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
83USBWebcamHeaderGen CamInternalAddons.h : B_WEBCAM_MKINTFUNC
84	: $(addonSources) ;
85USBWebcamHeaderGen CamInternalSensors.h : B_WEBCAM_DECLARE_SENSOR
86	: $(sensorsSources) ;
87USBWebcamHeaderGen CamInternalColorSpaceTransforms.h
88	: B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ;
89
90
91local architectureObject ;
92for architectureObject in [ MultiArchSubDirSetup ] {
93	on $(architectureObject) {
94
95		for sourceDir in $(sourceDirs) {
96			SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media
97				media-add-ons usb_webcam $(sourceDir) ] ;
98		}
99
100		Addon [ MultiArchDefaultGristFiles usb_webcam.media_addon ] :
101			$(addonSources)
102			$(csTransformsSources)
103			$(sensorsSources)
104			AddOn.cpp
105			Producer.cpp
106			CamBufferedFilterInterface.cpp
107			CamBufferingDeframer.cpp
108			CamColorSpaceTransform.cpp
109			CamDeframer.cpp
110			CamDevice.cpp
111			CamFilterInterface.cpp
112			CamRoster.cpp
113			CamSensor.cpp
114			CamStreamingDeframer.cpp
115			: be media $(usbKitLibraryName) [ TargetLibsupc++ ]
116		;
117	}
118}
119
120
121# force dependancies
122Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ;
123Includes [ FGristFiles CamDevice.cpp ] : [ FGristFiles CamInternalSensors.h ] ;
124Includes [ FGristFiles CamColorSpaceTransform.cpp ]
125	: [ FGristFiles CamInternalColorSpaceTransforms.h ] ;
126