-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (25 loc) · 787 Bytes
/
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
# Makefile for Basler pylon sample program
.PHONY: all clean
PROJECT = BASLER-EXEC
# The program to build
SRC = \
BASLER-EXEC.cpp \
OBJS = $(SRC:.cpp=.o)
# Installation directories for pylon
PYLON_ROOT ?= /opt/pylon5
# Build tools and flags
LD := $(CXX)
CPPFLAGS := $(shell $(PYLON_ROOT)/bin/pylon-config --cflags)
CXXFLAGS := #e.g., CXXFLAGS=-g -O0 for debugging
LDFLAGS := $(shell $(PYLON_ROOT)/bin/pylon-config --libs-rpath)
LDFLAGS += $(shell pkg-config --libs --static opencv)
LDLIBS := $(shell $(PYLON_ROOT)/bin/pylon-config --libs) -lwiringPi
# Rules for building
all: $(OBJS) $(PROJECT)
$(PROJECT): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
%.o : %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f $(OBJS)
rm -f $(PROJECT)