aboutsummaryrefslogtreecommitdiffstats
path: root/Make.rules
blob: a7d76d6ac9c168e1f5a00499a980720ef4509f15 (plain)
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
V4L_UTILS_VERSION=0.8.6

# These ones can be overriden from the cmdline

CFLAGS := -g -O1
CFLAGS += -Wall -Wpointer-arith
CXXFLAGS := $(CFLAGS)
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes

PREFIX = /usr/local
LIBDIR = $(PREFIX)/lib
# subdir below LIBDIR in which to install the libv4lx libc wrappers
LIBSUBDIR = libv4l
MANDIR = $(PREFIX)/share/man

# These ones should not be overriden from the cmdline

# Note the -I../.. this assumes all sources live in a 2 level dir hierarchy!
override CPPFLAGS += -I../../include -I../../lib/include -D_GNU_SOURCE -DV4L_UTILS_VERSION='"$(V4L_UTILS_VERSION)"'
override LDFLAGS += -L../../lib/libv4l1 -L../../lib/libv4l2 -L../../lib/libv4lconvert
# This is the soname version
LIB_RELEASE = 0

# And last various rules

%.o: %.c
	$(CC) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CFLAGS) -o $@ $<

%.o: %.cpp
	$(CXX) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<

%.so:
	$(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ $(LIBS_$*)
	ln -f -s $@.$(LIB_RELEASE) $@

%.a:
	$(AR) cqs $@ $^

clean::
	rm -f core core.[0123456789]* *~ *.o *.d *.a *.so* DEADJOE *.orig *.rej $(TARGETS)

Privacy Policy