summaryrefslogtreecommitdiff
path: root/v4l2-apps/Make.rules
blob: 5e471abcdb4fc871592ee45331af29c3281ddf3b (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
41
42
43
44
45
46
47
48
49
50
51
52
53
# dvb-apps common build rules

ifeq ($(origin CC),default)
CC := gcc
endif
export CC

ifeq ($(origin CFLAGS),undefined)
CFLAGS := -g -O1
endif
CFLAGS += -Wall -W -Wno-unused -Wshadow -Wpointer-arith -Wstrict-prototypes
CFLAGS += -fPIC
export CFLAGS

ifeq ($(V),1)
%.o: %.c
	$(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $<
%: %.o
	$(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
%: %.c
	$(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(filter %.o %.c,$^) $(LOADLIBES) $(LDLIBS) -o $@
%.so:
	$(LD) -shared -o $@ $^
%.a:
	$(AR) rcs $@ $^
else
%.o: %.c
	@echo CC $@
	@$(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $<
%: %.o
	@echo LD $@
	@$(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
%: %.c
	@echo CC $@
	@$(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(filter %.o %.c,$^) $(LOADLIBES) $(LDLIBS) -o $@
%.so:
	@echo LD $@
	@$(CC) -shared -o $@ $^
%.a:
	@echo AR $@
	@$(AR) rcs $@ $^
endif

clean::
	-rm -f core core.[0123456789]* *~ *.o
	rm -f *.d

-include *.d ...dummy

commit update pull push insmod rmmod whitespace:
	make -C ../.. $(MAKECMDGOALS)