代码拉取完成,页面将自动刷新
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
# Copyright 2018-2020 NXP
src=$(wildcard ./*.c)
obj=$(patsubst ./%.c, ./%.o, $(src))
includedir = /usr/include/nservo
libdir = /usr/lib
execdir = /usr/bin
PKG_CONFIG ?= /usr/bin/pkg-config
HOME_DIR ?= /root
console_tool_src=$(wildcard ./tool/console_tool.c)
console_tool_obj=$(patsubst ./%.c, ./%.o, $(console_tool_src))
nservo_run_src=$(wildcard ./tool/nservo_run.c)
nservo_run_obj=$(patsubst ./%.c, ./%.o, $(nservo_run_src))
nservo_client_src=$(wildcard ./tool/nservo_client.c)
nservo_client_obj=$(patsubst ./%.c, ./%.o, $(nservo_client_src))
pv_example_src=$(wildcard ./example/Profile_Velocty_Mode_Test_2HSS458-EC.c)
pv_example_obj=$(patsubst ./%.c, ./%.o, $(pv_example_src))
pp_example_src=$(wildcard ./example/Profile_Position_Mode_Test_2HSS458-EC.c)
pp_example_obj=$(patsubst ./%.c, ./%.o, $(pp_example_src))
csp_example_src=$(wildcard ./example/Cyclic_Position_Mode_Test_2HSS458-EC.c)
csp_example_obj=$(patsubst ./%.c, ./%.o, $(csp_example_src))
ifdef $(XENO_CONFIG)
CFLAGS := $(shell DESTDIR=$(XENO_DESTDIR) $(XENO_CONFIG) --skin=posix --cflags)
LDFLAGS := $(shell DESTDIR=${XENO_DESTDIR} $(XENO_CONFIG) --skin=posix --ldflags)
endif
CFLAGS += $(shell $(PKG_CONFIG) libxml-2.0 --cflags)
LDFLAGS += $(shell $(PKG_CONFIG) libxml-2.0 --libs)
CFLAGS += -I./include -Ddebug_level=debug_level_info
LDFLAGS += -lpthread -lm
lib = libnservo.a
all:lib console_tool nservo_run pv_example pp_example csp_example nservo_client
lib: $(obj)
$(AR) -cr $(lib) $^
console_tool: $(console_tool_obj) lib
$(CC) $< -o nser_console_tool -L. -lnservo -lethercat -lpthread $(LDFLAGS)
pv_example: $(pv_example_obj) lib
$(CC) $< -o pv_2hss458 -lnservo -L. -lethercat -lpthread $(LDFLAGS)
pp_example: $(pp_example_obj) lib
$(CC) $< -o pp_2hss458 -lnservo -L. -lethercat -lpthread $(LDFLAGS)
csp_example: $(csp_example_obj) lib
$(CC) $< -o csp_2hss458 -lnservo -L. -lethercat -lpthread $(LDFLAGS)
nservo_run: $(nservo_run_obj) lib
$(CC) $< -o nservo_run -lnservo -L. -lethercat -lpthread $(LDFLAGS)
nservo_client: $(nservo_client_obj) lib
$(CC) $< -o nservo_client $(LDFLAGS)
install-libs:
install -d -m 755 $(DESTDIR)$(includedir)
install -m 644 include/* $(DESTDIR)$(includedir)
install -d -m 755 $(DESTDIR)$(libdir)
install -m 644 libnservo.a $(DESTDIR)$(libdir)
install:
install -d -m 755 $(DESTDIR)$(execdir)
install -d -m 755 $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 755 nservo_run $(DESTDIR)$(execdir)
install -m 755 nservo_client $(DESTDIR)$(execdir)
install -m 755 nser_console_tool $(DESTDIR)$(execdir)
install -m 664 example/hss248_ec_config_pp.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/hss248_ec_config_pv.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/x3e_config.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/Delta-ASDA-B3-two-masters.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/Delta-ASDA-B3-csp.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/Delta-ASDA-B3-pp.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/Delta-ASDA-B3-pv.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/Delta-ASDA-B3-tp_arrays $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/x6b_sv680_delta_axis.xml $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/x6b_sv680_delta_tp_arrays $(DESTDIR)$(HOME_DIR)/nservo_example
install -m 664 example/x3e_csp_60_config.xml $(DESTDIR)$(HOME_DIR)/nservo_example
clean:
rm *.o *.a
%.o:%.c
$(CC) -c $(CFLAGS) -Wall -g $< -o $@
#-Wfatal-errors -Werror $(CC) -shared $(LDFLAGS) -o libnservo.so $< $(CC) -fpic -shared $(LDFLAGS) -o libnservo.so $<
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。