/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to common.mk

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Compiler and default flags
2
 
CC ?= gcc
3
 
CFLAGS ?= -O0
4
 
 
5
 
 
6
 
# Defaults for directories
7
 
ROOTDIR ?= $(shell pwd)
8
 
 
9
 
INCDIR ?= $(ROOTDIR)
10
 
BINDIR ?= $(ROOTDIR)
11
 
LIBDIR ?= $(ROOTDIR)
12
 
OBJDIR ?= $(ROOTDIR)
13
 
DEPENDDIR ?= $(ROOTDIR)
14
 
 
15
 
CXXFLAGS += $(addprefix -I ,$(INCDIR)) -fPIC
16
 
CFLAGS += $(addprefix -I ,$(INCDIR)) -fPIC -std=c99
17
 
 
18
 
# Source files in this directory
19
 
SRC = $(wildcard *.cpp)
20
 
SRCC = $(wildcard *.c)
21
 
 
22
 
SRC += $(wildcard ipecamera/*.cpp)
23
 
SRCC += $(wildcard ipecamera/*.c)
24
 
 
25
 
SRC += $(wildcard dma/*.cpp)
26
 
SRCC += $(wildcard dma/*.c)
27
 
 
28
 
# Corresponding object files 
29
 
OBJ = $(addprefix $(OBJDIR)/,$(SRC:.cpp=.o))
30
 
OBJ += $(addprefix $(OBJDIR)/,$(SRCC:.c=.o))
31
 
 
32
 
# Corresponding dependency files
33
 
DEPEND = $(addprefix $(DEPENDDIR)/,$(SRC:.cpp=.d)) 
34
 
DEPEND += $(addprefix $(DEPENDDIR)/,$(SRCC:.c=.d)) 
35
 
 
36
 
# This makes Verbose easier. Just prefix $(Q) to any command
37
 
ifdef VERBOSE
38
 
        Q ?= 
39
 
else
40
 
        Q ?= @
41
 
endif
42
 
 
43
 
###############################################################
44
 
# Target definitions
45
 
 
46
 
# Target for automatic dependency generation
47
 
depend: $(DEPEND) $(DEPENDC);
48
 
 
49
 
# This rule generates a dependency makefile for each source
50
 
$(DEPENDDIR)/%.d: %.c
51
 
        @echo -e "DEPEND \t$<"
52
 
        $(Q)$(CC) $(addprefix -I ,$(INCDIR)) -MM -MF $@ \
53
 
                -MT $(OBJDIR)/$(<:.c=.o) -MT $@ $< 
54
 
 
55
 
# This includes the automatically 
56
 
# generated dependency files
57
 
-include $(DEPEND)
58
 
 
59
 
$(OBJDIR)/%.o: %.c
60
 
        @echo -e "CC \t$<"
61
 
        $(Q)@$(CC) $(CFLAGS) -c -o $@ $<