-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
96 lines (75 loc) · 2.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-include config.mak
all: libusb-vcam.so vcam
include pi.mak
# WiFi hardware for spoofing (requires AP support)
WIFI_DEV ?= wlp0s20f3
VCAM_CORE += src/log.o src/vcamera.o src/packet.o src/ops.o src/canon.o src/fuji.o src/fuji_server.o src/ptpip.o
VCAM_CORE += src/canon_props.o src/data.o src/props.o src/fujissdp.o src/socket.o src/fuji_usb.o src/usbthing.o
VCAM_CORE += usb/device.o usb/usbstring.o usb/vhci.o
# include libusb-1.0 headers for .so
SO_CFLAGS := $(shell pkg-config --cflags libusb-1.0)
SO_FILES := $(VCAM_CORE) usb/libusb.o
VCAM_FILES := $(VCAM_CORE) src/main.o
VCAM_OTG_FILES := $(VCAM_CORE) src/otg.o
CFLAGS += -g -I. -Isrc/ -Iusb/ -L. -D HAVE_LIBEXIF -Wall -fPIC -Wall -Wshadow -Wcast-qual -Wpedantic -Werror=incompatible-pointer-types -Wstrict-aliasing=3
LDFLAGS += -L. -Wl,-rpath=.
# Used to access bin/
CFLAGS += '-D PWD="$(shell pwd)"'
# Is this actually needed by GCC?
$(SO_FILES): CFLAGS += $(SO_CFLAGS)
# generic libusb.so Canon EOS Device
libusb-vcam.so: $(SO_FILES)
$(CC) -g -ggdb $(SO_FILES) $(SO_CFLAGS) -lexif -shared -o libusb-vcam.so
vcam: $(VCAM_FILES)
$(CC) -g -ggdb $(VCAM_FILES) $(CFLAGS) -o vcam $(LDFLAGS) -lexif
install: vcam libusb-vcam.so
sudo cp vcam /usr/bin/
sudo cp libusb-vcam.so /usr/lib/
-include src/*.d
-include cpp/*.d
%.o: %.c $(H)
$(CC) -MMD -c $< $(CFLAGS) -o $@
%.o: %.cpp $(H)
g++ -MMD -c $< $(CFLAGS) -o $@
clean:
$(RM) main *.o *.so libgphoto2_port/*.o gphoto2/*.o *.out src/*.o tcp libgphoto2_port/*.o src/*.d usb/*.o usb/*.d
$(RM) fuji canon vcam vcam-otg vcam2
ln:
ln ../camlib/src/ptp.h src/ptp.h
ln ../camlib/src/cl_data.h src/cl_data.h
# Wireless AP networking Hacks
SSID ?= FUJIFILM-X30-ABCD
setup-fuji:
-sudo ip link add fuji_dummy type dummy
-sudo ip address add 10.0.0.1/24 dev fuji_dummy
-sudo ip address add 192.168.0.1/24 dev fuji_dummy
-sudo ip address add 200.201.202.203/24 dev fuji_dummy
-ip a
kill-fuji:
sudo ip link delete fuji_dummy
ap-fuji: setup-fuji
sudo bash scripts/create_ap $(WIFI_DEV) fuji_dummy $(SSID) $(PASSWORD)
test-fuji:
@while make vcam; do \
echo '------------------------------------------'; \
./vcam fuji_x_a2 --local; \
done
setup-canon:
-sudo ip link add canon_dummy type dummy
-sudo ip link set dev canon_dummy address '00:BB:C1:85:9F:AB'
-sudo ip link set canon_dummy up
-sudo ip route add 192.168.1.2 dev canon_dummy
-sudo ip address add 192.168.1.10/24 brd + dev canon_dummy noprefixroute
-ip a
ap-canon: setup-canon
sudo bash scripts/create_ap $(WIFI_DEV) canon_dummy 'EOST6{-464_Canon0A' $(PASSWORD) -g 192.168.1.2 --ieee80211n
kill-canon:
sudo ip link delete canon_dummy
test-canon:
@while make vcam; do \
echo '------------------------------------------'; \
./vcam canon_1300d; \
done
gfs:
-mkdir /dev/gadget
mount -t gadgetfs gadgetfs /dev/gadget