forked from billw2/pikrellcam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (36 loc) · 1.32 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
EXECUTABLE = ../pikrellcam
LIBKRELLM_ROOT := ../libkrellm
BUILDDIR = /tmp/build-pikrellcam
MODULES := glcd utils
LIBKRELLM_DIRS=$(addprefix $(LIBKRELLM_ROOT)/,$(MODULES))
#$(info $(LIBKRELLM_DIRS))
INCLUDES := $(addprefix -I,$(LIBKRELLM_DIRS))
#$(info $(INCLUDES))
MMAL_INCLUDE ?= -I/opt/vc/include \
-I/opt/vc/include/interface/vcos/pthreads \
-I/opt/vc/include/interface/vmcs_host/linux
MMAL_LIB ?= -L/opt/vc/lib -lbcm_host -lvcos -lmmal -lmmal_core -lmmal_util \
-lmmal_vc_client
FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES)
LIBS = $(MMAL_LIB) -lm -lpthread -lasound -lmp3lame
LOCAL_SRC = pikrellcam.c mmalcam.c motion.c event.c display.c config.c \
servo.c preset.c sunriset.c multicast.c audio.c \
tcpserver.c tcpserver.c tcpserver_mjpeg.c
KRELLMLIB_SRC = $(wildcard $(addsuffix /*.c,$(LIBKRELLM_DIRS)))
SOURCES = $(LOCAL_SRC) $(KRELLMLIB_SRC)
#$(info $(SOURCES))
KRELLMLIB_DEPS = $(wildcard $(addsuffix /*.h,$(LIBKRELLM_DIRS)))
DEPS = pikrellcam.h $(KRELLMLIB_DEPS)
#$(info $(DEPS))
OBJECTS = $(addprefix $(BUILDDIR)/, $(notdir $(SOURCES:%.c=%.o)))
#$(info $(OBJECTS))
VPATH = $(LIBKRELLM_DIRS)
$(BUILDDIR)/%.o: %.c $(DEPS)
$(CC) -c $(FLAGS) $< -o $@
all: dir $(EXECUTABLE)
dir:
mkdir -p $(BUILDDIR)
$(EXECUTABLE): $(OBJECTS)
$(CC) $^ -o $(EXECUTABLE) $(LIBS)
clean:
rm -f $(BUILDDIR)/*o $(EXECUTABLE)