-
Notifications
You must be signed in to change notification settings - Fork 173
/
Makefile
82 lines (64 loc) · 2.33 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
# DroidCam & DroidCamX (C) 2010-2021
# https://github.com/dev47apps
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Use at your own risk. See README file for more details.
#
# Variables with ?= can be changed during invocation
# Example:
# APPINDICATOR=ayatana-appindicator3-0.1 make droidcam
CC ?= gcc
CFLAGS ?=
APPINDICATOR ?= appindicator3-0.1
USBMUXD ?= libusbmuxd
GTK = `pkg-config --libs --cflags gtk+-3.0` `pkg-config --libs x11`
GTK += `pkg-config --libs --cflags $(APPINDICATOR)`
LIBAV = `pkg-config --libs --cflags libswscale libavutil`
JPEG = `pkg-config --libs --cflags libturbojpeg`
USBMUXD := `pkg-config --libs --cflags $(USBMUXD)`
LIBS = -lspeex -lasound -lpthread -lm
SRC = src/connection.c src/settings.c src/decoder*.c src/av.c src/usb.c src/queue.c
ifneq ($(findstring ayatana,$(APPINDICATOR)),)
CFLAGS += -DUSE_AYATANA_APPINDICATOR
endif
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),FreeBSD)
CC ?= $(shell pkg info | grep -o '^gcc[0-9]*' | head -n 1)
JPEG_DIR = /usr/local
JPEG_INCLUDE = $(JPEG_DIR)/include
JPEG_LIB = $(JPEG_DIR)/lib
USBMUXD = -lusbmuxd-2.0
endif
all: droidcam-cli droidcam
ifeq "$(RELEASE)" ""
package:
@echo "usage: RELEASE=2. make -B package"
else
CFLAGS += -Wall -O2
JPEG = -I/opt/libjpeg-turbo/include
USBMUXD = -I/opt/libimobiledevice/include
LIBAV = -L/opt/ffmpeg4/lib -lswscale -lavutil
SRC += /opt/libimobiledevice/lib/libusbmuxd.a
SRC += /opt/libimobiledevice/lib/libplist-2.0.a
SRC += /opt/libjpeg-turbo/lib64/libturbojpeg.a
.PHONY: package
package: all
zip "droidcam_$(RELEASE).zip" \
LICENSE README* icon2.png \
droidcam* install* uninstall* \
v4l2loopback/*
endif
#src/resources.c: .gresource.xml icon2.png
# glib-compile-resources .gresource.xml --generate-source --target=src/resources.c
droidcam-cli: LDLIBS += $(LIBAV) $(JPEG) $(USBMUXD) $(LIBS)
droidcam: LDLIBS += $(GTK) $(LIBAV) $(JPEG) $(USBMUXD) $(LIBS)
droidcam-cli: src/droidcam-cli.c $(SRC)
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
droidcam: src/droidcam.c src/resources.c $(SRC)
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
clean:
rm -f droidcam
rm -f droidcam-cli
make -C v4l2loopback clean