-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample.Makefile.old
executable file
·75 lines (58 loc) · 1.56 KB
/
sample.Makefile.old
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
63
64
65
66
67
68
69
70
71
72
73
74
75
# Parameters
# SRC_CS: The source C files to compie
# SRC_CPPS: The source CPP files to compile
# EXEC: The executable name
ifeq ($(SRC_CS) $(SRC_CPPS),)
$(error No source files specified)
endif
ifeq ($(EXEC),)
$(error No executable file specified)
endif
CC=gcc
CPP=g++
LD=$(CPP)
PUREGEV_ROOT ?= /opt/pleora/ebus_sdk
INC_DIR = $(PUREGEV_ROOT)/include
LIB_DIR = $(PUREGEV_ROOT)/lib
QT_LIB_DIR = $(PUREGEV_ROOT)/lib/qt/lib
ifneq ($(shell uname -m),x86_64)
GENICAM_LIB_DIR = $(LIB_DIR)/genicam/bin/Linux32_i86
else
GENICAM_LIB_DIR = $(LIB_DIR)/genicam/bin/Linux64_x64
endif
LD_LIBRARY_PATH=$(LIB_DIR):$(GENICAM_LIB_DIR):$(QT_LIB_DIR)
export LD_LIBRARY_PATH
ifdef _DEBUG
CFLAGS += -g -D_DEBUG
CPPFLAGS += -g -D_DEBUG
else
CFLAGS += -O3
CPPFLAGS += -O3
endif
CFLAGS += -I$(INC_DIR) -D_UNIX_ -D_LINUX_
CPPFLAGS += -I$(INC_DIR) -D_UNIX_ -D_LINUX_
LDFLAGS += -L$(LIB_DIR) \
-L$(GENICAM_LIB_DIR) \
-L/usr/local/lib \
-lPvBase \
-lPvDevice \
-lPvBuffer \
-lPvGUI \
-lPvPersistence \
-lPvGenICam \
-lPvStreamRaw \
-lPvStream \
-lPvTransmitterRaw \
-lPvVirtualDevice
OBJS += $(SRC_CPPS:%.cpp=%.o)
OBJS += $(SRC_CS:%.c=%.o)
all: $(EXEC)
$(EXEC): $(OBJS)
$(LD) $(OBJS) $(LDFLAGS) -o $@
%.o: %.cpp
$(CPP) $< -c $(CPPFLAGS) -o $@
%.o: %.c
$(CC) $< -c $(CFLAGS) -o $@
clean:
rm -rf $(OBJS) $(EXEC)
.PHONY: all clean