forked from icshwi/e3-ecmc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathecmc.Makefile
118 lines (99 loc) · 3.29 KB
/
ecmc.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Copyright (c) 2019 Jeong Han Lee
# Copyright (c) 2017 - 2019 European Spallation Source ERIC
#
# The program is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of the
# License, or any newer version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
#
#
# Author : Jeong Han Lee
# email : jeonghan.lee@gmail.com
# Date : Tuesday, September 17 11:30:53 CEST 2019
# version : 0.0.7
#
where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(E3_REQUIRE_TOOLS)/driver.makefile
include $(E3_REQUIRE_CONFIG)/DECOUPLE_FLAGS
ifneq ($(strip $(ASYN_DEP_VERSION)),)
asyn_VERSION=$(ASYN_DEP_VERSION)
endif
ifneq ($(strip $(EXPRTK_DEP_VERSION)),)
exprtk_VERSION=$(EXPRTK_DEP_VERSION)
endif
ifneq ($(strip $(MOTOR_DEP_VERSION)),)
motor_VERSION=$(MOTOR_DEP_VERSION)
endif
ifneq ($(strip $(RUCKIG_DEP_VERSION)),)
ruckig_VERSION=$(RUCKIG_DEP_VERSION)
endif
EXCLUDE_ARCHS += linux-ppc64e6500
EXCLUDE_ARCHS += linux-corei7-poky
ifeq ($(T_A),linux-x86_64)
# Assume that the etherlab user library is done via
# https://github.com/icshwi/etherlabmaster
USR_INCLUDES += -I/opt/etherlab/include
USR_CFLAGS += -fPIC
USR_LDFLAGS += -L /opt/etherlab/lib
USR_LDFLAGS += -lethercat
USR_LDFLAGS += -Wl,-rpath=/opt/etherlab/lib
else
ifeq ($(T_A),linux-arm)
# Assume that the etherlab user library is done via
# https://github.com/icshwi/etherlabmaster
USR_INCLUDES += -I/opt/etherlab/include
USR_CFLAGS += -fPIC
USR_LDFLAGS += -L /opt/etherlab/lib
USR_LDFLAGS += -lethercat
USR_LDFLAGS += -Wl,-rpath=/opt/etherlab/lib
else
# Assume that the etherlab user library is done via
# Yocto ESS Linux bb recipe
USR_INCLUDES += -I$(SDKTARGETSYSROOT)/usr/include/etherlab
USR_CFLAGS += -fPIC
USR_LDFLAGS += -L $(SDKTARGETSYSROOT)/usr/lib/etherlab
USR_LDFLAGS += -lethercat
USR_LDFLAGS += -Wl,-rpath=$(SDKTARGETSYSROOT)/usr/lib/etherlab
USR_LDFLAGS += -lstdc++
endif
endif
APP:=devEcmcSup
APPSRC:=$(APP)
APPSRC_ETHERCAT:=$(APPSRC)/ethercat
APPSRC_MOTION:=$(APPSRC)/motion
APPSRC_COM:=$(APPSRC)/com
APPSRC_MAIN:=$(APPSRC)/main
APPSRC_PLC:=$(APPSRC)/plc
APPSRC_MISC:=$(APPSRC)/misc
APPSRC_MOTOR:=$(APPSRC)/motor
APPSRC_PLUGIN:=$(APPSRC)/plugin
APPDIRS +=${APPSRC_ETHERCAT}
APPDIRS +=${APPSRC_MOTION}
APPDIRS +=${APPSRC_COM}
APPDIRS +=${APPSRC_MAIN}
APPDIRS +=${APPSRC_PLC}
APPDIRS +=${APPSRC_MISC}
APPDIRS +=${APPSRC_MOTOR}
APPDIRS +=${APPSRC_PLUGIN}
USR_INCLUDES += -I$(where_am_I)$(APPSRC)
SOURCES += $(foreach d,${APPDIRS}, $(wildcard $d/*.cpp))
SOURCES += $(foreach d,${APPDIRS}, $(wildcard $d/*.c))
SOURCES += gitversion.c
HEADERS += $(foreach d,${APPDIRS}, $(wildcard $d/*.h))
DBDS += $(APPSRC_COM)/ecmcController.dbd
DBDS += $(APPSRC_MOTOR)/ecmcMotorRecordSupport.dbd
gitversion.c:
$(QUIET)$(RM) $@
$(QUIET)sh $(where_am_I)tools/gitversion.sh $@
.PHONY: vlibs db
db:
vlibs: