forked from libuvc/libuvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.libusbxdebug
More file actions
85 lines (70 loc) · 2.03 KB
/
Makefile.libusbxdebug
File metadata and controls
85 lines (70 loc) · 2.03 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
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
# Makefile for libuvc for MinGW-W64 and libusbx.a
# (C)2016, 2017 Raphael Kim / rageworx
#
# ------------------------------------------------------------------------------
# Pre requirements :
#
# libusbx
# 1. download or clone source in here:
# https://github.com/rageworx/libusbx
# 2. Build source with Makefile.mingw* for Debug and Release.
# 3. Put built static lib into libusbx directory.
# 4. Put header file into libusbx, too.
#
# libjpeg
# 1. download source
# 2. configure with --enable-static CFLAGS=-mwindows,
# 3. then make, make install-lib
#
# To enable build for embedded linux, you may encomment next 2 lines.
# CCPREPATH = ${ARM_LINUX_GCC_PATH}
# CCPREFIX = arm-linux-
# To enable build for embedded linux, change following line.
# CCPATH = ${CCPREPATH}/${CCPREFIX}
CCPATH =
# Compiler configure.
GCC = ${CCPATH}gcc
GPP = ${CCPATH}g++
AR = ${CCPATH}ar
SOURCEDIR = ./src
INCDIR = ./include
OBJDIR = ./obj/Debug
USBXDIR = ./libusbx
OUTDIR = ./lib
OUTBIN = libuvcd.a
DEFINEOPT = -DDEBUG
OPTIMIZEOPT = -g -mwindows
USRLOCALDIR = /usr/local
CFLAGS = -I./include
CFLAGS += -I$(SOURCEDIR)
CFLAGS += -I$(USBXDIR)
CFLAGS += -I$(USRLOCALDIR)/include
CFLAGS += $(DEFINEOPT) $(OPTIMIZEOPT)
LFLAGS = -L$(USBXDIR)
LFLAGS += -L/usr/local/lib
LFLAGS += -lusbxd
LFLAGS += -ljpeg
SRCS = $(SOURCEDIR)/ctrl.c
SRCS += $(SOURCEDIR)/ctrl-gen.c
SRCS += $(SOURCEDIR)/device.c
SRCS += $(SOURCEDIR)/diag.c
SRCS += $(SOURCEDIR)/frame.c
SRCS += $(SOURCEDIR)/frame-mjpeg.c
SRCS += $(SOURCEDIR)/init.c
SRCS += $(SOURCEDIR)/misc.c
SRCS += $(SOURCEDIR)/stream.c
OBJS = $(SRCS:$(SOURCEDIR)/%.c=$(OBJDIR)/%.o)
all: prepare clean ${OUTDIR}/${OUTBIN}
prepare:
@mkdir -p ${OBJDIR}
@mkdir -p ${OUTDIR}
$(OBJS): $(OBJDIR)/%.o: $(SOURCEDIR)/%.c
@echo "Building $@ ... "
@$(GCC) $(CFLAGS) $(LFLAGS) -c $< -o $@
$(OUTDIR)/$(OUTBIN): $(OBJS)
@echo "Generating $@ ..."
@$(AR) -q $@ $(OBJDIR)/*.o
@echo "done."
clean:
@rm -rf ${OBJDIR}/*
@rm -rf ${OUTDIR}/${OUTBIN}