-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (47 loc) · 1.38 KB
/
Makefile
File metadata and controls
58 lines (47 loc) · 1.38 KB
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
# Add more verbose logging and build debug symbols (if set).
DEBUG ?=
# Use a fake camera implementation for testing (if set).
BAMBU_FAKE ?=
USER_CONFIG_DIR ?= $(HOME)/.config
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
USER_CONFIG_DIR := '$(HOME)/Library/Application Support'
endif
# Path to the Bambu Studio plugin directory. Assumes it is installed and ran at
# least once to download the expected plugins.
PLUGIN_PATH := $(USER_CONFIG_DIR)/BambuStudio/plugins
# Which server implementation to use, including:
# - HTTP: Multipart JPEG stream using microhttpd
# - RTP: RTP video stream using FFmpeg
SERVER ?= HTTP
ifdef DEBUG
CFLAGS := -g -DDEBUG
endif
LDLIBS := -lpthread
OBJECTS :=
ifdef BAMBU_FAKE
CFLAGS += $(shell pkg-config --cflags libjpeg)
LDLIBS += $(shell pkg-config --libs libjpeg)
OBJECTS += bambu_fake.o
else
LDFLAGS := \
-L$(PLUGIN_PATH) \
-Wl,-rpath,$(PLUGIN_PATH)
LDLIBS += -lBambuSource
OBJECTS += bambu.o
endif
ifeq ($(SERVER), HTTP)
CFLAGS += $(shell pkg-config --cflags libmicrohttpd)
LDLIBS += $(shell pkg-config --libs libmicrohttpd)
OBJECTS += server_microhttpd.o
else
CFLAGS += $(shell pkg-config --cflags libavcodec libavformat libavutil)
LDLIBS += $(shell pkg-config --libs libavcodec libavformat libavutil)
OBJECTS += server_ffmpeg_rtp.o
endif
CFLAGS += $(EXTRA_CFLAGS)
bambucam: $(OBJECTS)
.PHONY: clean
clean:
@rm -fv *.o
@rm -fv bambucam