This repository has been archived by the owner on Jan 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.84 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
57
58
59
60
61
62
CC=g++
CFLAGS=-c -Wall -std=c++0x
INCLUDES=-Iinclude/ -I/usr/include/python2.7
LDFLAGS=-lopencv_core -lopencv_highgui -lopencv_imgproc -lpython2.7
UNAME_P:=$(shell uname -p)
SOURCE_DIR=src
SOURCES=main.cpp ConfigManager.cpp Camera.cpp DetectObject.cpp EmailWrapper.cpp
PYTHON_SOURCES=SendEmail.py
ifneq ($(filter unknown,$(UNAME_P)),)
RASPIFLAGS=-lwiringPi -L/usr/lib/uv4l/uv4lext/armv6l -luv4lext -Wl,-rpath,'/usr/lib/uv4l/uv4lext/armv6l'
SOURCES+=magneto.c sonar.c pir.c
else
RASPIFLAGS=
endif
OBJECT_DIR=build
OBJECTS=$(addsuffix .o, $(basename $(SOURCES)))
EXECUTABLE_DIR=bin
EXECUTABLE=vasc
all: $(OBJECTS) $(EXECUTABLE)
execute: all
@./$(EXECUTABLE_DIR)/$(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS) $(EXECUTABLE_DIR)
$(CC) $(addprefix $(OBJECT_DIR)/,$(OBJECTS)) $(INCLUDES) $(LDFLAGS) $(RASPIFLAGS) -o $(EXECUTABLE_DIR)/$@
@cp $(addprefix $(SOURCE_DIR)/,$(PYTHON_SOURCES)) $(EXECUTABLE_DIR)
main.o: $(SOURCE_DIR)/main.cpp $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
ConfigManager.o: $(SOURCE_DIR)/ConfigManager.cpp $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
Camera.o: $(SOURCE_DIR)/Camera.cpp $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
DetectObject.o: $(SOURCE_DIR)/DetectObject.cpp $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
EmailWrapper.o: $(SOURCE_DIR)/EmailWrapper.cpp $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
magneto.o: $(SOURCE_DIR)/magneto.c $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
sonar.o: $(SOURCE_DIR)/sonar.c $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
pir.o: $(SOURCE_DIR)/pir.c $(OBJECT_DIR)
$(CC) $< $(CFLAGS) $(INCLUDES) -o $(OBJECT_DIR)/$@
$(EXECUTABLE_DIR):
@mkdir $(EXECUTABLE_DIR)
$(OBJECT_DIR):
@mkdir $(OBJECT_DIR)
.PHONY: clean
clean:
@rm -rf $(EXECUTABLE_DIR) $(OBJECT_DIR)