-
Notifications
You must be signed in to change notification settings - Fork 55
/
Makefile
61 lines (45 loc) · 1.21 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
# Copyright (C) 2022 DEV47APPS, github.com/dev47apps
DATA_DIR ?= data
BUILD_DIR ?= build
LIB_DLL ?= $(BUILD_DIR)/droidcam-obs.so
RM ?= rm -f
CXX ?= g++
CXXFLAGS += -std=c++17 -Wall -fPIC
INCLUDES += -Isrc/
STATIC +=
LDD_DIRS +=
LDD_LIBS +=
LDD_FLAG +=
SRC += $(shell ls src/*.cc src/sys/unix/*.cc)
.PHONY: run clean
all: $(BUILD_DIR) $(LIB_DLL)
debug: CXXFLAGS += -DDEBUG
debug: all
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
include linux/linux.mk
run: debug
obs
endif
ifeq ($(UNAME),Darwin)
include macos/macOS.mk
run: debug
rm ~/Library/ApplicationSupport/obs-studio/logs/* && PATH='' /Applications/OBS.app/Contents/MacOS/OBS
endif
$(BUILD_DIR):
@[ -d "$(BUILD_DIR)" ] || {\
echo missing build directory: $(BUILD_DIR);\
echo use: mkdir $(BUILD_DIR);\
exit 1;\
}
$(LIB_DLL): $(SRC)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDD_DIRS) $(LDD_LIBS) $(LDD_FLAG) $^ $(STATIC) -o $@
clean:
$(RM) $(BUILD_DIR)/*.o $(BUILD_DIR)/*.so $(BUILD_DIR)/*.exe
adbz:
$(CXX) $(CXXFLAGS) -o$(BUILD_DIR)/adbz.exe src/test/adbz.c
test: adbz
$(CXX) $(CXXFLAGS) -o$(BUILD_DIR)/test.exe -DDEBUG -DTEST -Isrc/test/ $(INCLUDES) \
src/net.c src/command.c src/sys/unix/cmd.c \
src/test/main.c
$(BUILD_DIR)/test.exe